tquant: sync 86 test cases with pto-isa + template infrastructure - #1206
Open
mediocrity-luo wants to merge 6 commits into
Open
tquant: sync 86 test cases with pto-isa + template infrastructure#1206mediocrity-luo wants to merge 6 commits into
mediocrity-luo wants to merge 6 commits into
Conversation
mediocrity-luo
commented
Aug 10, 2026
Contributor
- lib/TileOps/a5/tquant.py: tquant templates (INT8_SYM/ASYM, MXFP8 ND/DN/Exp2D)
- lib/TileOps/a5/tinsert.py: tinsert template
- lib/TileOps/init.py: register tquant/tinsert templates
- include/PTO/IR/PTOOps.td: tquant op definitions
- lib/PTO/IR/VPTO.cpp: vbitcast sub-byte support (f4e2m1x2→ui8)
- lib/PTO/IR/PTO.cpp: TQuantMxOp verifier (grp_axis/interleave/DN refactor)
- lib/PTO/Transforms/ExpandTileOp.cpp: tquant operand attrs
- lib/PTO/Transforms/InsertTemplateAttributes.cpp: tquant template attrs
- lib/PTO/Transforms/PTOToEmitC.cpp: TQuantMxOp EmitC lowering
- lib/PTO/Transforms/VPTO{CANN900,}LLVMEmitter.cpp: vcvt f16→bf16 support
- tools/ptoas/ptoas.cpp: InsertTemplateAttributes pass in VPTO pipeline
- ptodsl/ptodsl/_ops.py: tquant/tassign/tquant_mx/set_ctrl API + vcvt_contract
- ptodsl/ptodsl/_tile_namespace.py: tile.quant namespace
- ptodsl/ptodsl/pto.py: export set_ctrl, tassign
- ptodsl/ptodsl/tilelib/serving/{client,daemon}.py: daemon error traceback
- test/tilelib-st/a5/tquant/: 86 cases (INT8 6 + MXFP8 49 + MXFP4 25 + DN 6)
- test/tilelib-st/a5/{tassign,tinsert_vec_to_mat}/: supporting tests
- test/lit/pto/tquant_*.pto: lit tests
- test/tilelib-st/common.py: bf16/assert_close enhancement
- lib/TileOps/a5/tquant.py: tquant templates (INT8_SYM/ASYM, MXFP8 ND/DN/Exp2D)
- lib/TileOps/a5/tinsert.py: tinsert template
- lib/TileOps/__init__.py: register tquant/tinsert templates
- include/PTO/IR/PTOOps.td: tquant op definitions
- lib/PTO/IR/VPTO.cpp: vbitcast sub-byte support (f4e2m1x2→ui8)
- lib/PTO/IR/PTO.cpp: TQuantMxOp verifier (grp_axis/interleave/DN refactor)
- lib/PTO/Transforms/ExpandTileOp.cpp: tquant operand attrs
- lib/PTO/Transforms/InsertTemplateAttributes.cpp: tquant template attrs
- lib/PTO/Transforms/PTOToEmitC.cpp: TQuantMxOp EmitC lowering
- lib/PTO/Transforms/VPTO{CANN900,}LLVMEmitter.cpp: vcvt f16→bf16 support
- tools/ptoas/ptoas.cpp: InsertTemplateAttributes pass in VPTO pipeline
- ptodsl/ptodsl/_ops.py: tquant/tassign/tquant_mx/set_ctrl API + vcvt_contract
- ptodsl/ptodsl/_tile_namespace.py: tile.quant namespace
- ptodsl/ptodsl/pto.py: export set_ctrl, tassign
- ptodsl/ptodsl/tilelib/serving/{client,daemon}.py: daemon error traceback
- test/tilelib-st/a5/tquant/: 86 cases (INT8 6 + MXFP8 49 + MXFP4 25 + DN 6)
- test/tilelib-st/a5/{tassign,tinsert_vec_to_mat}/: supporting tests
- test/lit/pto/tquant_*.pto: lit tests
- test/tilelib-st/common.py: bf16/assert_close enhancement
# Conflicts: # tools/ptoas/ptoas.cpp
The debug tofile calls wrote to the hard-coded /tmp/opencode path, which does not exist on CI runners and caused PermissionError on every TileLib ST case during golden comparison.
When case.py is loaded via importlib (run_tilelib_st.py / pytest entry), sys.path[0] is not the case directory, so 'from _gen_data_nd import ...' fails with ModuleNotFoundError. Add the case directory (parent) to sys.path alongside the existing test/tilelib-st/ path (parent.parent for common). This fixes 32 CI failures where MXFP4/DN cases could not import their helper modules.
…tead of seeded rng _gen_pattern's 'normal' pattern used np.random.lognormal/np.random.rand (global random state) instead of the seeded rng (np.random.default_rng). This caused CI/local data divergence because the global random state depends on prior call history, not the per-case seed. Fix: use rng.lognormal/rng.random so the seed_k parameter actually controls data generation for 'normal' pattern cases.
mediocrity-luo
force-pushed
the
tquant-only
branch
from
August 11, 2026 11:55
3c7cb2a to
524c580
Compare
The MLIR-generated bindings expose tmp as a keyword-only optional operand (tsel(mask, src0, src1, dst, *, tmp=None), tsels(mask, src, scalar, dst, *, tmp=None)) since the optional-tmp change. The ptodsl wrappers still passed tmp positionally, colliding with the dst slot: TypeError: tsels() takes 4 positional arguments but 5 were given This matches the pattern applied to trow*/tcolarg*/txor/txors in 68e079d, which missed tsel/tsels.
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.