Repository navigation
test(pto): cover explicit VMI broadcast-load composition - #13
Open
mouliangyu wants to merge 10 commits into
Open
mouliangyu wants to merge 10 commits into
mouliangyu wants to merge 10 commits into
Conversation
Add the VMI (virtual machine instruction) intrinsics and PTO codegen:
- tilelang/ascend/language/vmi.py: the T.vmi.* surface, exposed as T.vmi
through tilelang.ascend.language - vector loads/stores, masks,
arithmetic/bitwise/shift ops, vcvt (incl. packed FP4 sources),
vinterpret_cast, vzip/vunzip, precision-aware vdiv, gather/scatter,
histogram ops, and register allocation helpers
- 54 tl.vmi.* TIR builtins registered in src/op/builtin.{h,cc}
- PTO codegen: pto.vmi.* emission with typed-literal wrapping, FP4
pair expansion, eager vreg allocation for vector local.var, the
signed/unsigned integer type split (pto.si*/pto.ui*), and a clear
AscendC rejection diagnostic; generated kernels import
tilelang.contrib.ptodsl before ptodsl so this build's native
libraries load ahead of the PTODSL MLIR modules
- KernelParam.storage_shape: packed-storage shapes for sub-byte dtypes
Co-authored-by: KurrinQu <qukelin1991@163.com>
Co-authored-by: Jay Zhuang <80731350+learning-chip@users.noreply.github.com>
Co-authored-by: Zhang Zhendong <zhendong404@gmail.com>
Co-authored-by: cj <erhsh_165@126.com>
Add the T.Parallel -> PTO VMI vectorization pipeline: - Verify -> Legalize -> Vectorize pass pipeline ahead of AscendSimdVFLowerParallel, with pass registration, the Python interface, and routing tests (SIMT and hand-written VMI regions are bypassed inside the passes; control-flow rewriting stays out of scope) - Verify: shared region scan and inverse lane-mapping analysis, the LayoutInference-for-PTO branch, 1D/2D lane mapping, and T.SimdVF(lanes=...) frontend support, with contract tests - Vectorize: chunk loops with dynamic prefix tail masks, remaining state reset per row/column and per sequential unit, and dtype/cast codegen for element-wise add/sub/mul/div, unary abs/exp/log/sqrt, and f32 <-> f16/bf16 conversions; runtime lane-uniform float computations are rejected (they would stay scalar inside SIMD_VF) - Device tests: element-wise, tail-mask, and FP8 suites Co-authored-by: qukelin <qukelin1991@163.com> Co-authored-by: jimmychou <47636600+jimmychou0@users.noreply.github.com>
The si32 reducer strategy serves both signed si32 and signless i32 carriers, but created its initial-value constant as signless pto.i32. With TIR signedness now carried into PTODSL, scalar.select mixing an si32 carrier with an i32 constant is rejected by current PTOAS (pto.select integer arms require matching types). Both creation points (_emit_warp_hw_reduce and _emit_cross_warp_reduce) now share _identity_const: the strategy key still selects the constant's numeric value, while its integer type follows the carrier value's own signedness (signed carriers get pto.si32, signless keep pto.i32).
mouliangyu
force-pushed
the
codex/pto-broadcast-load
branch
from
October 22, 2026 02:54
81ccae1 to
9b28c67
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PTO broadcast loads use an explicit
vloadfollowed byvbrc. Add standalone code-generation regression coverage for scalar loads and two grouped variants, checking size, group, stride, and the SSA connection between the operations. The generated Python source must compile and must not use the removeddist_modeargument.This branch is based on the current
pto-dev(eac39889226b0b403bdc112a7217f85a5127f62c). The production API changes are already in that base; this PR adds only the regression test and does not duplicate the optional-mask change in #9.Validation: rebuilt TileLang native objects from this base and linked against the matching TVM revision;
pytest -q testing/ascend/language/pto/test_pto_vmi_broadcast_composition.py: 3 passed. This validates generated PTODSL source, not device performance.