[TEST] Cover Gluon core simulation ops - #451
Conversation
Performance Benchmark
Iterations: 1 warmup + 20 measured |
773718e to
8928cab
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8928cab66b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| elem_type, | ||
| ), | ||
| elem_type, | ||
| _get_handle_layout(scale), |
There was a problem hiding this comment.
Preserve the data layout for FP4 upcasts
When an FP4 value is upcast with a separate scale tensor, this tags the unpacked result with the scale tensor's layout rather than the packed data/output layout. In MXFP4-style kernels the scale tile often has a different layout/shape from the values it scales, so the next Gluon operation infers the wrong distributed layout and can reject otherwise valid combinations with data-layout tensors as a layout mismatch. The FP8 path just above keeps the source layout; the FP4 path should not derive the result layout from scale.
Useful? React with 👍 / 👎.
Summary
Adds focused CPU regression coverage for Gluon core simulation ops and fixes the simulator layout propagation needed by those kernels. The new tests cover scalar range loops,
program_id,arange, maskedload/store, 2D broadcasted offsets,SliceLayout,convert_layout, and elementwise add without requiring a CUDA device.Refactors the Gluon simulator builder so inherited Triton interpreter operations can attach Gluon layouts through a shared
_WRAPPED_LAYOUT_OPSpath while keeping special layout/signature cases as explicit builder methods.create_broadcast,create_expand_dims, andcreate_histogramnow delegate to the parent interpreter implementation for data behavior and attach the Gluon layout locally. Tensor-producing paths use_tensor_resultso layout metadata stays attached to returned handles.Validation
PYTHONPATH=/mnt/keren/triton-viz pytest tests/end_to_end/test_gluon_core_ops.py tests/end_to_end/test_gluon.py tests/end_to_end/test_core.py tests/unit/test_adapters.py -qpre-commit run --files triton_viz/core/simulation/gluon.py