-
Notifications
You must be signed in to change notification settings - Fork 21
Feature/kimi milm models #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
cfed9c4
feat: add batch hash lookup vectorized probe example
hengliao1972 1fab0ab
chore: update batch_hash_lookup example
hengliao1972 6c868b8
feat: use pl.break_() for early exit in batch_hash_lookup probe loop
hengliao1972 10e0902
Merge branch 'main' of github.com:hengliao1972/pypto-lib
hengliao1972 b0dca3c
feat: add qwen3_decode_expand_mixed_kernel example (pl.slice, single-…
hengliao1972 3f36422
Merge pr/pl-break-batch-hash-lookup: add qwen3_decode_expand_mixed_ke…
hengliao1972 fd725ad
Merge branch 'hw-native-sys:main' into main
hengliao1972 85b7bd5
Add qwen3_decode_expand_mixed_kernel compiler pass dumps and reports
hengliao1972 6cb22aa
Add Qwen3 tilelet-aware decode example with dual-maximised tiling
hengliao1972 4419b1e
feat(models): Add Kimi K2 and Xiaomi MiLM PyPTO implementations
23b963b
Merge branch 'main' of github.com:hengliao1972/pypto-lib
1df6762
fix(models): Address CI feedback on Kimi K2 and MiLM implementations
d2d25ad
fix(models): Remove Chinese characters from docstrings
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
examples/batch_hash_lookup_dump/passes_dump/00_frontend.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # pypto.program: BatchHashLookup | ||
| import pypto.language as pl | ||
|
|
||
| @pl.program | ||
| class BatchHashLookup: | ||
| @pl.function | ||
| def batch_hash_lookup(self, search_key: pl.Tensor[[1024, 64, 32], pl.INT32], hash_table_size: pl.Tensor[[64, 32], pl.INT32], hash_base_ptr: pl.Tensor[[64, 32], pl.INT32], hash_pool: pl.Tensor[[64, 128, 32], pl.INT32], value_ptr_out: pl.Tensor[[1024, 64, 32], pl.INT32]) -> pl.Tensor[[1024, 64, 32], pl.INT32]: | ||
| for b in pl.parallel(0, 1024, 32): | ||
| with pl.incore(): | ||
| for ti in pl.parallel(0, 64, 32): | ||
| zero_src: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(search_key, [1, 32], [b, ti, 0]) | ||
| zero_tile: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.mul(zero_src, 0) | ||
| value_ptr_out: pl.Tensor[[1024, 64, 32], pl.INT32] = pl.tensor.assemble(value_ptr_out, zero_tile, [b, ti, 0]) | ||
| for probe in pl.range(0, 8, 1): | ||
| round_has_active: pl.Scalar[pl.INDEX] = 0 | ||
| with pl.incore(): | ||
| for b in pl.parallel(0, 1024, 32): | ||
| for ti in pl.parallel(0, 64, 32): | ||
| keys_tile: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(search_key, [1, 32], [b, ti, 0]) | ||
| mixed: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.mul(keys_tile, 2654435761) | ||
| h_probe: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.ands(pl.tensor.add(mixed, probe * 2246822519), 64 - 1) | ||
| cand_key: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.mul(keys_tile, 0) | ||
| cand_val: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.mul(keys_tile, 0) | ||
| for bucket in pl.range(0, 64, 1): | ||
| bucket_mask: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.cmps(h_probe, bucket, cmp_type=0) | ||
| bucket_keys: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(hash_pool, [1, 32], [ti, bucket, 0]) | ||
| bucket_vals: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(hash_pool, [1, 32], [ti, 64 + bucket, 0]) | ||
| cand_key: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.sel(bucket_mask, bucket_keys, cand_key) | ||
| cand_val: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.sel(bucket_mask, bucket_vals, cand_val) | ||
| result_prev: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(value_ptr_out, [1, 32], [b, ti, 0]) | ||
| active_mask: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.cmps(result_prev, 0, cmp_type=0) | ||
| active_count: pl.Tensor[[1, 1], pl.INDEX] = pl.tensor.row_sum(active_mask) | ||
| active_count_s: pl.Scalar[pl.INDEX] = pl.tensor.read(active_count, [0, 0]) | ||
| if active_count_s != 0: | ||
| round_has_active: pl.Scalar[pl.INDEX] = 1 | ||
| key_match: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.cmp(cand_key, keys_tile, cmp_type=0) | ||
| hit_mask: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.and(active_mask, key_match) | ||
| result_next: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.sel(hit_mask, cand_val, result_prev) | ||
| value_ptr_out: pl.Tensor[[1024, 64, 32], pl.INT32] = pl.tensor.assemble(value_ptr_out, result_next, [b, ti, 0]) | ||
| if round_has_active == 0: | ||
| break | ||
| return value_ptr_out | ||
42 changes: 42 additions & 0 deletions
42
examples/batch_hash_lookup_dump/passes_dump/01_after_UnrollLoops.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # pypto.program: BatchHashLookup | ||
| import pypto.language as pl | ||
|
|
||
| @pl.program | ||
| class BatchHashLookup: | ||
| @pl.function | ||
| def batch_hash_lookup(self, search_key: pl.Tensor[[1024, 64, 32], pl.INT32], hash_table_size: pl.Tensor[[64, 32], pl.INT32], hash_base_ptr: pl.Tensor[[64, 32], pl.INT32], hash_pool: pl.Tensor[[64, 128, 32], pl.INT32], value_ptr_out: pl.Tensor[[1024, 64, 32], pl.INT32]) -> pl.Tensor[[1024, 64, 32], pl.INT32]: | ||
| for b in pl.parallel(0, 1024, 32): | ||
| with pl.incore(): | ||
| for ti in pl.parallel(0, 64, 32): | ||
| zero_src: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(search_key, [1, 32], [b, ti, 0]) | ||
| zero_tile: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.mul(zero_src, 0) | ||
| value_ptr_out: pl.Tensor[[1024, 64, 32], pl.INT32] = pl.tensor.assemble(value_ptr_out, zero_tile, [b, ti, 0]) | ||
| for probe in pl.range(0, 8, 1): | ||
| round_has_active: pl.Scalar[pl.INDEX] = 0 | ||
| with pl.incore(): | ||
| for b in pl.parallel(0, 1024, 32): | ||
| for ti in pl.parallel(0, 64, 32): | ||
| keys_tile: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(search_key, [1, 32], [b, ti, 0]) | ||
| mixed: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.mul(keys_tile, 2654435761) | ||
| h_probe: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.ands(pl.tensor.add(mixed, probe * 2246822519), 64 - 1) | ||
| cand_key: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.mul(keys_tile, 0) | ||
| cand_val: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.mul(keys_tile, 0) | ||
| for bucket in pl.range(0, 64, 1): | ||
| bucket_mask: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.cmps(h_probe, bucket, cmp_type=0) | ||
| bucket_keys: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(hash_pool, [1, 32], [ti, bucket, 0]) | ||
| bucket_vals: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(hash_pool, [1, 32], [ti, 64 + bucket, 0]) | ||
| cand_key: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.sel(bucket_mask, bucket_keys, cand_key) | ||
| cand_val: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.sel(bucket_mask, bucket_vals, cand_val) | ||
| result_prev: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(value_ptr_out, [1, 32], [b, ti, 0]) | ||
| active_mask: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.cmps(result_prev, 0, cmp_type=0) | ||
| active_count: pl.Tensor[[1, 1], pl.INDEX] = pl.tensor.row_sum(active_mask) | ||
| active_count_s: pl.Scalar[pl.INDEX] = pl.tensor.read(active_count, [0, 0]) | ||
| if active_count_s != 0: | ||
| round_has_active: pl.Scalar[pl.INDEX] = 1 | ||
| key_match: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.cmp(cand_key, keys_tile, cmp_type=0) | ||
| hit_mask: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.and(active_mask, key_match) | ||
| result_next: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.sel(hit_mask, cand_val, result_prev) | ||
| value_ptr_out: pl.Tensor[[1024, 64, 32], pl.INT32] = pl.tensor.assemble(value_ptr_out, result_next, [b, ti, 0]) | ||
| if round_has_active == 0: | ||
| break | ||
| return value_ptr_out |
51 changes: 51 additions & 0 deletions
51
examples/batch_hash_lookup_dump/passes_dump/02_after_ConvertToSSA.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # pypto.program: BatchHashLookup | ||
| import pypto.language as pl | ||
|
|
||
| @pl.program | ||
| class BatchHashLookup: | ||
| @pl.function | ||
| def batch_hash_lookup(self, search_key_0: pl.Tensor[[1024, 64, 32], pl.INT32], hash_table_size_0: pl.Tensor[[64, 32], pl.INT32], hash_base_ptr_0: pl.Tensor[[64, 32], pl.INT32], hash_pool_0: pl.Tensor[[64, 128, 32], pl.INT32], value_ptr_out_0: pl.Tensor[[1024, 64, 32], pl.INT32]) -> pl.Tensor[[1024, 64, 32], pl.INT32]: | ||
| for b_0, (value_ptr_out_iter_1,) in pl.parallel(0, 1024, 32, init_values=(value_ptr_out_0,)): | ||
| with pl.incore(): | ||
| for ti_0, (value_ptr_out_iter_3,) in pl.parallel(0, 64, 32, init_values=(value_ptr_out_iter_1,)): | ||
| zero_src_0: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(search_key_0, [1, 32], [b_0, ti_0, 0]) | ||
| zero_tile_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.mul(zero_src_0, 0) | ||
| value_ptr_out_5: pl.Tensor[[1024, 64, 32], pl.INT32] = pl.tensor.assemble(value_ptr_out_iter_3, zero_tile_0, [b_0, ti_0, 0]) | ||
| value_ptr_out_4: pl.Tensor[[1024, 64, 32], pl.INT32] = pl.yield_(value_ptr_out_5) | ||
| value_ptr_out_2: pl.Tensor[[1024, 64, 32], pl.INT32] = pl.yield_(value_ptr_out_4) | ||
| for probe_0, (b_iter_1, ti_iter_1, value_ptr_out_iter_6) in pl.range(0, 8, 1, init_values=(b_0, ti_0, value_ptr_out_2)): | ||
| round_has_active_0: pl.Scalar[pl.INDEX] = 0 | ||
| with pl.incore(): | ||
| for b_3, (round_has_active_iter_1, ti_iter_3, value_ptr_out_iter_8) in pl.parallel(0, 1024, 32, init_values=(round_has_active_0, ti_iter_1, value_ptr_out_iter_6)): | ||
| for ti_5, (round_has_active_iter_3, value_ptr_out_iter_10) in pl.parallel(0, 64, 32, init_values=(round_has_active_iter_1, value_ptr_out_iter_8)): | ||
| keys_tile_0: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(search_key_0, [1, 32], [b_3, ti_5, 0]) | ||
| mixed_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.mul(keys_tile_0, 2654435761) | ||
| h_probe_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.ands(pl.tensor.add(mixed_0, probe_0 * 2246822519), 64 - 1) | ||
| cand_key_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.mul(keys_tile_0, 0) | ||
| cand_val_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.mul(keys_tile_0, 0) | ||
| for bucket_0, (cand_key_iter_1, cand_val_iter_1) in pl.range(0, 64, 1, init_values=(cand_key_0, cand_val_0)): | ||
| bucket_mask_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.cmps(h_probe_0, bucket_0, cmp_type=0) | ||
| bucket_keys_0: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(hash_pool_0, [1, 32], [ti_5, bucket_0, 0]) | ||
| bucket_vals_0: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(hash_pool_0, [1, 32], [ti_5, 64 + bucket_0, 0]) | ||
| cand_key_3: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.sel(bucket_mask_0, bucket_keys_0, cand_key_iter_1) | ||
| cand_val_3: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.sel(bucket_mask_0, bucket_vals_0, cand_val_iter_1) | ||
| cand_key_2, cand_val_2 = pl.yield_(cand_key_3, cand_val_3) | ||
| result_prev_0: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(value_ptr_out_iter_10, [1, 32], [b_3, ti_5, 0]) | ||
| active_mask_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.cmps(result_prev_0, 0, cmp_type=0) | ||
| active_count_0: pl.Tensor[[1, 1], pl.INDEX] = pl.tensor.row_sum(active_mask_0) | ||
| active_count_s_0: pl.Scalar[pl.INDEX] = pl.tensor.read(active_count_0, [0, 0]) | ||
| if active_count_s_0 != 0: | ||
| round_has_active_5: pl.Scalar[pl.INDEX] = 1 | ||
| round_has_active_6: pl.Scalar[pl.INDEX] = pl.yield_(round_has_active_5) | ||
| else: | ||
| round_has_active_6: pl.Scalar[pl.INDEX] = pl.yield_(round_has_active_iter_3) | ||
| key_match_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.cmp(cand_key_2, keys_tile_0, cmp_type=0) | ||
| hit_mask_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.and(active_mask_0, key_match_0) | ||
| result_next_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.sel(hit_mask_0, cand_val_2, result_prev_0) | ||
| value_ptr_out_12: pl.Tensor[[1024, 64, 32], pl.INT32] = pl.tensor.assemble(value_ptr_out_iter_10, result_next_0, [b_3, ti_5, 0]) | ||
| round_has_active_4, value_ptr_out_11 = pl.yield_(round_has_active_6, value_ptr_out_12) | ||
| round_has_active_2, ti_4, value_ptr_out_9 = pl.yield_(round_has_active_4, ti_5, value_ptr_out_11) | ||
| if round_has_active_2 == 0: | ||
| break | ||
| b_2, ti_2, value_ptr_out_7 = pl.yield_(b_3, ti_4, value_ptr_out_9) | ||
| return value_ptr_out_7 |
52 changes: 52 additions & 0 deletions
52
examples/batch_hash_lookup_dump/passes_dump/03_after_FlattenCallExpr.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # pypto.program: BatchHashLookup | ||
| import pypto.language as pl | ||
|
|
||
| @pl.program | ||
| class BatchHashLookup: | ||
| @pl.function | ||
| def batch_hash_lookup(self, search_key_0: pl.Tensor[[1024, 64, 32], pl.INT32], hash_table_size_0: pl.Tensor[[64, 32], pl.INT32], hash_base_ptr_0: pl.Tensor[[64, 32], pl.INT32], hash_pool_0: pl.Tensor[[64, 128, 32], pl.INT32], value_ptr_out_0: pl.Tensor[[1024, 64, 32], pl.INT32]) -> pl.Tensor[[1024, 64, 32], pl.INT32]: | ||
| for b_0, (value_ptr_out_iter_1,) in pl.parallel(0, 1024, 32, init_values=(value_ptr_out_0,)): | ||
| with pl.incore(): | ||
| for ti_0, (value_ptr_out_iter_3,) in pl.parallel(0, 64, 32, init_values=(value_ptr_out_iter_1,)): | ||
| zero_src_0: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(search_key_0, [1, 32], [b_0, ti_0, 0]) | ||
| zero_tile_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.mul(zero_src_0, 0) | ||
| value_ptr_out_5: pl.Tensor[[1024, 64, 32], pl.INT32] = pl.tensor.assemble(value_ptr_out_iter_3, zero_tile_0, [b_0, ti_0, 0]) | ||
| value_ptr_out_4: pl.Tensor[[1024, 64, 32], pl.INT32] = pl.yield_(value_ptr_out_5) | ||
| value_ptr_out_2: pl.Tensor[[1024, 64, 32], pl.INT32] = pl.yield_(value_ptr_out_4) | ||
| for probe_0, (b_iter_1, ti_iter_1, value_ptr_out_iter_6) in pl.range(0, 8, 1, init_values=(b_0, ti_0, value_ptr_out_2)): | ||
| round_has_active_0: pl.Scalar[pl.INDEX] = 0 | ||
| with pl.incore(): | ||
| for b_3, (round_has_active_iter_1, ti_iter_3, value_ptr_out_iter_8) in pl.parallel(0, 1024, 32, init_values=(round_has_active_0, ti_iter_1, value_ptr_out_iter_6)): | ||
| for ti_5, (round_has_active_iter_3, value_ptr_out_iter_10) in pl.parallel(0, 64, 32, init_values=(round_has_active_iter_1, value_ptr_out_iter_8)): | ||
| keys_tile_0: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(search_key_0, [1, 32], [b_3, ti_5, 0]) | ||
| mixed_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.mul(keys_tile_0, 2654435761) | ||
| _t0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.add(mixed_0, probe_0 * 2246822519) | ||
| h_probe_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.ands(_t0, 64 - 1) | ||
| cand_key_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.mul(keys_tile_0, 0) | ||
| cand_val_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.mul(keys_tile_0, 0) | ||
| for bucket_0, (cand_key_iter_1, cand_val_iter_1) in pl.range(0, 64, 1, init_values=(cand_key_0, cand_val_0)): | ||
| bucket_mask_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.cmps(h_probe_0, bucket_0, cmp_type=0) | ||
| bucket_keys_0: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(hash_pool_0, [1, 32], [ti_5, bucket_0, 0]) | ||
| bucket_vals_0: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(hash_pool_0, [1, 32], [ti_5, 64 + bucket_0, 0]) | ||
| cand_key_3: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.sel(bucket_mask_0, bucket_keys_0, cand_key_iter_1) | ||
| cand_val_3: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.sel(bucket_mask_0, bucket_vals_0, cand_val_iter_1) | ||
| cand_key_2, cand_val_2 = pl.yield_(cand_key_3, cand_val_3) | ||
| result_prev_0: pl.Tensor[[1, 32], pl.INT32] = pl.tensor.view(value_ptr_out_iter_10, [1, 32], [b_3, ti_5, 0]) | ||
| active_mask_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.cmps(result_prev_0, 0, cmp_type=0) | ||
| active_count_0: pl.Tensor[[1, 1], pl.INDEX] = pl.tensor.row_sum(active_mask_0) | ||
| active_count_s_0: pl.Scalar[pl.INDEX] = pl.tensor.read(active_count_0, [0, 0]) | ||
| if active_count_s_0 != 0: | ||
| round_has_active_5: pl.Scalar[pl.INDEX] = 1 | ||
| round_has_active_6: pl.Scalar[pl.INDEX] = pl.yield_(round_has_active_5) | ||
| else: | ||
| round_has_active_6: pl.Scalar[pl.INDEX] = pl.yield_(round_has_active_iter_3) | ||
| key_match_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.cmp(cand_key_2, keys_tile_0, cmp_type=0) | ||
| hit_mask_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.and(active_mask_0, key_match_0) | ||
| result_next_0: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.sel(hit_mask_0, cand_val_2, result_prev_0) | ||
| value_ptr_out_12: pl.Tensor[[1024, 64, 32], pl.INT32] = pl.tensor.assemble(value_ptr_out_iter_10, result_next_0, [b_3, ti_5, 0]) | ||
| round_has_active_4, value_ptr_out_11 = pl.yield_(round_has_active_6, value_ptr_out_12) | ||
| round_has_active_2, ti_4, value_ptr_out_9 = pl.yield_(round_has_active_4, ti_5, value_ptr_out_11) | ||
| if round_has_active_2 == 0: | ||
| break | ||
| b_2, ti_2, value_ptr_out_7 = pl.yield_(b_3, ti_4, value_ptr_out_9) | ||
| return value_ptr_out_7 |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 1373
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 571
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 1168
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 1387
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 1230
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 49
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 1061
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 3786
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 235
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 49
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 928
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 49
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 49
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 49
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 51
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 8625
🏁 Script executed:
Repository: hw-native-sys/pypto-lib
Length of output: 49
Fix the reserved keyword usage in tensor operation calls and regenerate pass dumps.
The source compiler is emitting
pl.tensor.and(...)andpl.tensor.ands(...)calls, which use Python's reserved keywordandas a method name. This makes all 13 pass-dump files unparsable: lines 37 (and similar lines in later passes) containhit_mask: pl.Tensor[[1, 32], pl.INDEX] = pl.tensor.and(active_mask, key_match), which is invalid Python syntax.Verify the issue with:
The problem persists across all compilation stages. Fix the tensor operation names in the code generator (replace
and/andswith safe alternatives likebit_and/bit_andsor similar), regenerate all pass-dump artifacts, and add a Python syntax validation check to CI to prevent similar regressions.🧰 Tools
🪛 Ruff (0.15.6)
[warning] 37-37: Expected an identifier, but found a keyword
andthat cannot be used here(invalid-syntax)
🤖 Prompt for AI Agents