Dynamic A5 sim DSL examples#821
Conversation
Codex Review该评论由 review 机器人自动更新。
SummaryReview failed at stage Findings未生成结构化 findings,因为 review 过程提前失败。 Log Tail |
There was a problem hiding this comment.
Code Review
This pull request introduces a new example file, dynamic_softmax_launch.py, which demonstrates a dynamic-shape row-wise softmax launch demo using PTODSL. The feedback highlights a potential issue with using Python's built-in hash() function to seed the random number generator, as hash randomization makes it non-deterministic across different runs. A deterministic seeding approach is suggested to ensure reproducible test inputs.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| def make_case_inputs(case: dict[str, object]): | ||
| seq = int(case["seq"]) | ||
| rows = int(case["rows"]) | ||
| rng = np.random.RandomState(hash(case["name"]) & 0xFFFFFFFF) |
There was a problem hiding this comment.
Using Python's built-in hash() function on strings for seeding the random number generator is non-deterministic across different Python processes/runs due to hash randomization. This can lead to non-reproducible test inputs, making debugging flaky test failures or comparing performance runs difficult. Consider using a deterministic seed based on the case name, such as the sum of its character codes.
| rng = np.random.RandomState(hash(case["name"]) & 0xFFFFFFFF) | |
| seed = sum(ord(c) for c in case["name"]) | |
| rng = np.random.RandomState(seed) |
| pto.set_flag("MTE2", "V", event_id=0) | ||
| pto.wait_flag("MTE2", "V", event_id=0) | ||
|
|
||
| with pto.simd(): |
There was a problem hiding this comment.
Actually you don't need pto.simd() under explicit mode
No description provided.