Commit 359d3e9
committed
Eliminate duplicated softmax recomputation in indexer loss.
By inserting `jax.lax.optimization_barrier` after the head aggregation step
in `calculate_indexer_loss`, we force the compiler to reuse the head-aggregated
intermediate tensor for the subsequent sequence reduction
instead of recomputing the entire softmax pipeline from raw QK scores.
TAG=agy
CONV=5ff94b54-4171-4309-8704-6046df05eb131 parent 48c7da3 commit 359d3e9
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1077 | 1077 | | |
1078 | 1078 | | |
1079 | 1079 | | |
| 1080 | + | |
| 1081 | + | |
1080 | 1082 | | |
1081 | 1083 | | |
1082 | 1084 | | |
| |||
0 commit comments