Conversation
andrej
approved these changes
Sep 8, 2026
andrej
left a comment
Collaborator
There was a problem hiding this comment.
As with the other PR, please add something that disables this on CI, or we'll likely OOM. Then I think this is good. Thanks!
Comment on lines
+109
to
+116
|
|
||
| A rule that sets `commands_are_independent` emits one command per artifact in | ||
| its worklist, with no artifact depending on another's output -- kernel object | ||
| compiles are the case that matters, and they were costing the SUM of their | ||
| walls (7.9 s of a 17.1 s encoder-MHA build for two kernels). | ||
|
|
||
| Bounded by cores: each kernel compile is a single-threaded clang peaking near | ||
| 205 MB of RSS. Set IRON_COMPILE_JOBS to override. |
Collaborator
There was a problem hiding this comment.
Suggested change
| A rule that sets `commands_are_independent` emits one command per artifact in | |
| its worklist, with no artifact depending on another's output -- kernel object | |
| compiles are the case that matters, and they were costing the SUM of their | |
| walls (7.9 s of a 17.1 s encoder-MHA build for two kernels). | |
| Bounded by cores: each kernel compile is a single-threaded clang peaking near | |
| 205 MB of RSS. Set IRON_COMPILE_JOBS to override. | |
| A rule that sets `commands_are_independent` emits one command per artifact in | |
| executes them in parallel. Set IRON_COMPILE_JOBS to override. |
| #: none of them consuming another's output. `execute` may then run them | ||
| #: concurrently. Default off: a rule that batches dependent steps into one | ||
| #: application must keep its order, and only the rule knows which it is. | ||
| commands_are_independent: bool = False |
Collaborator
There was a problem hiding this comment.
Suggested change
| commands_are_independent: bool = False | |
| # Set by a rule whose `compile()` emits one command per worklist artifact, | |
| # none of them consuming another's output. `execute` may then run them | |
| # concurrently. Default off: a rule that batches dependent steps into one | |
| # application must keep its order, and only the rule knows which it is. |
execute() ran every command of every rule one after another, so a design's kernel objects cost the SUM of their compiles: 7.9 s of a 17.1 s encoder-MHA build for two kernels, 2.6 s once parallel. Only the rule knows whether its commands are independent, so it declares it; KernelCompilationRule does.
atassis
force-pushed
the
pr/parallel-rule-commands
branch
from
September 11, 2026 17:14
051dd1c to
c480669
Compare
andrej
enabled auto-merge
September 17, 2026 18:01
Contributor
CI Test Results3424c3c (2026_09_17_19_23_46) IRON - CI SummaryExamplesiron/applications/llama_3.2_1b
Smalliron/operators/axpy
iron/operators/dequant
iron/operators/elementwise_add
iron/operators/elementwise_mul
iron/operators/gelu
iron/operators/gemm
iron/operators/gemv
iron/operators/layer_norm
iron/operators/leaky_relu
iron/operators/mem_copy
iron/operators/mha
iron/operators/relu
iron/operators/repeat
iron/operators/rms_norm
iron/operators/rope
iron/operators/sigmoid
iron/operators/silu
iron/operators/softmax
iron/operators/strided_copy
iron/operators/swiglu_decode
iron/operators/swiglu_prefill
iron/operators/tanh
iron/operators/transpose
Krackan - SmallIRONTested on iron/operators/axpy
iron/operators/dequant
iron/operators/elementwise_add
iron/operators/elementwise_mul
iron/operators/gelu
iron/operators/gemm
iron/operators/gemv
iron/operators/layer_norm
iron/operators/leaky_relu
iron/operators/mem_copy
iron/operators/mha
iron/operators/relu
iron/operators/repeat
iron/operators/rms_norm
iron/operators/rope
iron/operators/sigmoid
iron/operators/silu
iron/operators/softmax
iron/operators/strided_copy
iron/operators/swiglu_decode
iron/operators/swiglu_prefill
iron/operators/tanh
iron/operators/transpose
Krackan - ExamplesIRONTested on iron/applications/llama_3.2_1b
Phoenix - SmallIRONTested on iron/operators/axpy
iron/operators/dequant
iron/operators/elementwise_add
iron/operators/elementwise_mul
iron/operators/gelu
iron/operators/gemm
iron/operators/gemv
iron/operators/layer_norm
iron/operators/leaky_relu
iron/operators/mem_copy
iron/operators/relu
iron/operators/repeat
iron/operators/rms_norm
iron/operators/rope
iron/operators/sigmoid
iron/operators/silu
iron/operators/softmax
iron/operators/strided_copy
iron/operators/swiglu_decode
iron/operators/swiglu_prefill
iron/operators/tanh
iron/operators/transpose
Phoenix - ExamplesIRONTested on Trend tables omitted, the comment hit GitHub's size limit. Full report in the workflow run. |
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.
A compilation rule whose commands are independent of one another now has them run
concurrently instead of one after the next.
Added
commands_are_independentonCompilationRule, default off. A rule sets it when itscompile()emits one command per worklist artifact with none of them consuminganother's output.
IRON_COMPILE_JOBSto override the concurrency.Changed
_execute_ruleruns a rule's commands in parallel when the rule declares themindependent, and serially otherwise. Kernel object compiles are the case that motivated
it: they were costing the sum of their walls, 7.9 s of a 17.1 s encoder-MHA build for two
kernels. Bounded by cores — each kernel compile is a single-threaded clang peaking near
205 MB of RSS.
Removed
PR Merge Checklist
develcommit and pointing todevel.