Skip to content

fix(dynamo): normalize scalar values at engine boundaries - #4628

Open
narendasan wants to merge 1 commit into
narendasan/fix-engine-symbol-remapfrom
narendasan/fix-engine-scalar-io
Open

fix(dynamo): normalize scalar values at engine boundaries#4628
narendasan wants to merge 1 commit into
narendasan/fix-engine-symbol-remapfrom
narendasan/fix-engine-scalar-io

Conversation

@narendasan

Copy link
Copy Markdown
Collaborator

Summary

  • materialize scalar partition inputs as zero-dimensional CUDA tensors before calling the Tensor[] execute_engine schema
  • restore scalar engine outputs with aten.item for their original consumers
  • skip scalar input shape metadata and select output placement from the first tensor input
  • keep inlined execute_engine graphs compatible with AOTInductor serialization

Issues

Closes #4614
Closes #4616
Closes #4617
Closes #4620

Tests

Stack

2 of 7. Base: #4627. Follow-up: narendasan/fix-device-placement.

Materialize scalar partition inputs as zero-dimensional CUDA tensors before calling the Tensor[] execute_engine schema, and restore scalar engine outputs with aten.item for their original consumers. The meta kernel now skips scalar input metadata and selects output placement from the first tensor input.

Fixes #4614
Fixes #4616
Fixes #4617
Fixes #4620

Tests:
- pytest tests/py/dynamo/models/test_exporter_inlining.py -n0 (7 passed)
- pytest tests/py/dynamo/models/test_meta_kernel_shape_inference.py -n0 (12 passed)
- original issue reproductions for #4614, #4616, #4617, and #4620
- #4620 AOTInductor package creation succeeded
@github-actions github-actions Bot added component: tests Issues re: Tests component: core Issues re: The core compiler component: api [Python] Issues re: Python API component: runtime component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Aug 28, 2026
@meta-cla meta-cla Bot added the cla signed label Aug 28, 2026
@github-actions
github-actions Bot requested a review from lanluo-nvidia August 28, 2026 02:59
@narendasan
narendasan requested a review from apbose August 28, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed component: api [Python] Issues re: Python API component: core Issues re: The core compiler component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: runtime component: tests Issues re: Tests

Projects

None yet

1 participant