Repository navigation
Namespace immutable constants per method in to_native (#23891) - #23891
JakeStevens wants to merge 5 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/23891
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Unclassified FailureAs of commit 27fff9b with merge base c45d76f ( UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@JakeStevens has exported this pull request. If you are a Meta employee, you can view the originating Diff in D125294428. |
This PR needs a
|
Summary:
Edge lowering mints `_lifted_tensor_constant{i}` names independently
per method, so unrelated scalars (e.g. an fp32 attention scale and an
int64 zero) collide under one data key when packaging multiple
methods, and `to_native` rejected the package. Namespace only those
auto-generated keys per method (`<method>/<key>`) in both the merged
graph blob (new `rename_data_keys` in `graph_serialize.py`, walking
the same references as `collect_data_keys`) and the constant dicts;
identical tensors stay shared, mutated keys are never renamed, and
genuine parameter/buffer fqn collisions still raise.
Differential Revision: D125294428
6c40a75 to
7567aa6
Compare
Summary: Pull Request resolved: pytorch#23891 Edge lowering mints `_lifted_tensor_constant{i}` names independently per method, so unrelated scalars (e.g. an fp32 attention scale and an int64 zero) collide under one data key when packaging multiple methods, and `to_native` rejected the package. Namespace only those auto-generated keys per method (`<method>/<key>`) in both the merged graph blob (new `rename_data_keys` in `graph_serialize.py`, walking the same references as `collect_data_keys`) and the constant dicts; identical tensors stay shared, mutated keys are never renamed, and genuine parameter/buffer fqn collisions still raise. Differential Revision: D125294428
7567aa6 to
91fd717
Compare
Summary:
Edge lowering mints `_lifted_tensor_constant{i}` names independently
per method, so unrelated scalars (e.g. an fp32 attention scale and an
int64 zero) collide under one data key when packaging multiple
methods, and `to_native` rejected the package. Namespace only those
auto-generated keys per method (`<method>/<key>`) in both the merged
graph blob (new `rename_data_keys` in `graph_serialize.py`, walking
the same references as `collect_data_keys`) and the constant dicts;
identical tensors stay shared, mutated keys are never renamed, and
genuine parameter/buffer fqn collisions still raise.
Differential Revision: D125294428
91fd717 to
75bf79f
Compare
Summary: Pull Request resolved: pytorch#23891 Edge lowering mints `_lifted_tensor_constant{i}` names independently per method, so unrelated scalars (e.g. an fp32 attention scale and an int64 zero) collide under one data key when packaging multiple methods, and `to_native` rejected the package. Namespace only those auto-generated keys per method (`<method>/<key>`) in both the merged graph blob (new `rename_data_keys` in `graph_serialize.py`, walking the same references as `collect_data_keys`) and the constant dicts; identical tensors stay shared, mutated keys are never renamed, and genuine parameter/buffer fqn collisions still raise. Differential Revision: D125294428
75bf79f to
bd4eaab
Compare
…23891) Summary: Pull Request resolved: pytorch#23891 Edge lowering generates `_lifted_tensor_constant{i}` keys independently for each method. When methods use different scalar values under the same generated key, `to_native` rejects the combined program. Always namespace generated immutable lifted constants as `<method>/<key>`, including single-method programs. Update the constant dictionaries and graph references together through a shared `map_data_keys` traversal, including quantization metadata and nested graphs. Equal tensors under different keys still deduplicate when saving the `.ptn`. Mutable keys keep their existing names, parameter/buffer conflicts continue to raise, and explicit keys occupying a generated namespace are rejected. Authored with assistance from OpenAI Codex. Differential Revision: D125294428
to_native (#23891)
…23891) Summary: Edge lowering generates `_lifted_tensor_constant{i}` keys independently for each method. When methods use different scalar values under the same generated key, `to_native` rejects the combined program. Always namespace generated immutable lifted constants as `<method>/<key>`, including single-method programs. Update the constant dictionaries and graph references together through a shared `map_data_keys` traversal, including quantization metadata and nested graphs. Equal tensors under different keys still deduplicate when saving the `.ptn`. Mutable keys keep their existing names, parameter/buffer conflicts continue to raise, and explicit keys occupying a generated namespace are rejected. Authored with assistance from OpenAI Codex. Differential Revision: D125294428
bd4eaab to
0bac518
Compare
digantdesai
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Summary: Add `ggml-org/llama.cpp` under `backends/native/third-party`, pinned to `620d2225cc436ab0b001e3200e590e3b286ef9ab`, matching the internal dependency. The full submodule retains the upstream license and copyright notices. Authored with AI assistance from Codex. Differential Revision: D125694754
…n` runner (pytorch#23811) Summary: Pull Request resolved: pytorch#23811 Add engine-independent CMake libraries for the native graph, PTN package reader, program runtime, engine interface, and standalone API. `EXECUTORCH_BUILD_NATIVE` enables the common libraries; `EXECUTORCH_BUILD_NATIVE_VULKAN` also enables `native_vulkan_engine`. `EXECUTORCH_BUILD_NATIVE_VISION_RUNNER` (requires `EXECUTORCH_BUILD_NATIVE_VULKAN`) additionally builds the `examples/vision` classification runner as `run_classification` plus its `native_runner_utils` library. The runner links `native_vulkan_engine` and gflags and installs to `bin/`. Its existing `test_runner_utils.cpp` coverage runs as `native_runner_utils_test` under `EXECUTORCH_BUILD_TESTS`. Authored with Codex and Muse Code. Differential Revision: D125084367
Summary: Pull Request resolved: pytorch#23891 Exported methods can reuse a constant name with different immutable tensors, causing `to_native` to reject the combined program. Namespace every immutable constant as `<method>/<key>`, including single-method programs, and update its graph references, including quantization metadata and nested graphs. Identical tensors still deduplicate when saving the `.ptn`. Keys mutated by any method retain their original names throughout the program, preserving shared state for readers and writers. Reject differing values for shared mutable keys and collisions between final names. Authored with assistance from OpenAI Codex. Differential Revision: D125294428
to_native (#23891)to_native (#23891)
0bac518 to
97051f4
Compare
Summary: Add separate Linux jobs for `runtime`, `ggml`, and `vulkan`, running each native test suite once and building `run_classification` in the Vulkan job. Scope PR triggers to relevant build inputs. Authored with AI assistance from Codex. Differential Revision: D125695225
Summary: Pull Request resolved: pytorch#23891 Exported methods can reuse a constant name with different immutable tensors, causing `to_native` to reject the combined program. Namespace every immutable constant as `<method>/<key>`, including single-method programs, and update its graph references, including quantization metadata and nested graphs. Identical tensors still deduplicate when saving the `.ptn`. Keys mutated by any method retain their original names throughout the program, preserving shared state for readers and writers. Reject differing values for shared mutable keys and collisions between final names. Authored with assistance from OpenAI Codex. Differential Revision: D125294428
f807a6e to
fb49267
Compare
Summary: Pull Request resolved: pytorch#23891 Exported methods can reuse a constant name with different immutable tensors, causing `to_native` to reject the combined program. Namespace every immutable constant as `<method>/<key>`, including single-method programs, and update its graph references, including quantization metadata and nested graphs. Identical tensors still deduplicate when saving the `.ptn`. Keys mutated by any method retain their original names throughout the program, preserving shared state for readers and writers. Reject differing values for shared mutable keys and collisions between final names. Authored with assistance from OpenAI Codex. Differential Revision: D125294428
Summary: Pull Request resolved: pytorch#23899 Add `EXECUTORCH_BUILD_NATIVE_LLM_RUNNER` to build and install `run_hf_llm_vulkan` and `run_hf_llm_ggml` for the enabled engines. Share gflags setup with the vision runner, resolve tokenizers with regex lookahead support, and add `native_llm_runner_utils_test`. Document building and running the GGML CPU LLM runner. Authored with assistance from Codex. Differential Revision: D125479665
Summary: Pull Request resolved: pytorch#23891 Exported methods can reuse a constant name with different immutable tensors, causing `to_native` to reject the combined program. Namespace every immutable constant as `<method>/<key>`, including single-method programs, and update its graph references, including quantization metadata and nested graphs. Identical tensors still deduplicate when saving the `.ptn`. Keys mutated by any method retain their original names throughout the program, preserving shared state for readers and writers. Reject differing values for shared mutable keys and collisions between final names. Authored with assistance from OpenAI Codex. Differential Revision: D125294428
fb49267 to
27fff9b
Compare
Summary:
Exported methods can reuse a constant name with different immutable tensors, causing
to_nativeto reject the combined program. Namespace every immutable constant as<method>/<key>, including single-method programs, and update its graph references, including quantization metadata and nested graphs. Identical tensors still deduplicate when saving the.ptn.Keys mutated by any method retain their original names throughout the program, preserving shared state for readers and writers. Reject differing values for shared mutable keys and collisions between final names.
Authored with assistance from OpenAI Codex.
Differential Revision: D125294428