[BUG][intel:xe2] shuffle_down of a local variable returns the lane's own value across the warp boundary
Maintainer antworten meist innerhalb von 2 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 22/100
Rechercherichtung
The repro is in the issue body: a Mojo kernel calling max.gpu.primitives.warp.shuffle_down on a 32-lane block, comparing a local-variable operand against a directly loaded one. Start by reproducing it on the intel:xe2 target and confirming lanes 8-15 return their own value. The payload does not name the files where the lowering happens, so locating the cause is the hard part. Done means the local-operand shuffle matches the direct-load result, and lane_group_reduce with num_lanes=4, stride=8 returns 48.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
max.gpu.primitives.warp.shuffle_down returns the calling lane's own value (not the source lane's value) for any lane whose source lane_id + offset crosses into the next warp — but only when the shuffled operand is a local variable. A directly-loaded value shuffles correctly across the warp boundary.
This is deterministic on the Intel Arc Pro B60 (Xe2) target.
Environment
- Target:
intel:xe2(Arc Pro B60, 16-lane warp) - IGC
2.41.15, compute-runtime1.17.39758 - Built via Bazel with
--target-accelerator=intel:xe2 - Single device pinned via
ZE_AFFINITY_MASK=1
Minimal repro
Value at lane i = i; block of 32 lanes (two 16-lane warps). Uses the full-mask form shuffle_down(val, offset).
from max.gpu import thread_idx
from max.gpu.primitives.warp import shuffle_down
def kernel(res: MutPointer[Scalar[.float32], MutAnyOrigin]):
var lane = Int(thread_idx.x)
var val: SIMD[.float32, 1] = SIMD[.float32, 1](Float32(lane)) # value at lane i == i
var local = val # LOCAL variable (the trigger)
# var direct = <a value loaded straight from memory, NOT via a local> (control)
# offset 8: lanes 8..15 read from lane+8, which crosses into the next warp at 16
res[lane] = shuffle_down(val=local, offset=8)[0] # WRONG on lanes 8-15
# res[lane] = shuffle_down(val=direct, offset=8)[0] # CORRECT everywhere
Observed (deterministic)
shuffle_down(local, 8)(local operand) → wrong on lanes 8–15: they get their own value, not the value fromlane+8.shuffle_down(local, 4)→ wrong on lanes 12–15.shuffle_down(direct, 8)(directly-loaded operand) → all correct, including the cross-warp reads (lane 0→8, lane 16→24).
The distinguishing factor is whether the operand is a local register vs. a directly-loaded value; the warp-boundary crossing alone is not sufficient (the direct case crosses the boundary and is correct).
Why it matters
- This matches the "out-of-range shuffle returns self" signature, but it is triggered by cross-warp-local, not merely out-of-range.
- It directly affects the stdlib
lane_group_reducebutterfly (res = func(res, shuffle(res, off))) on any cross-warp use, so an out-of-warp strided group silently produces a wrong result on a 16-lane warp (e.g.lane_group_reducewithnum_lanes=4, stride=8returns 16 where the expected sum is 48).
Expected
shuffle_down(local, 8) should return the value from lane+8 for lanes 8–15 (the cross-warp case), matching the directly-loaded behavior.
- Vorherrschende Sprache
- Mojo
- Sterne
- 30.2k
- Forks
- 3.2k
- Ø Merge
- 6 T. 20 Std.
- Gemergte PRs (30 T.)
- 25
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus modular/modular
-
bug_feature_triaged Team: Mojo Libraries
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 2 Tagen
-
bug bug_feature_triaged documentation mojo
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 2 Tagen
-
`Counter.lt()` and `Counter.gt()` disagree with `__eq__`, and `a.lt(a)` can be `True`Evtl. vergeben @YidaWeng hat das vor 2 Tagen übernommen. Offenbug_feature_triaged Team: Mojo Libraries
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
modular/modular#7696 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 2 Tagen
-
[BUG] `Counter` `-=`, `+=` and `&=` leave keys behind when they remove many keysEvtl. vergeben @Tharun-Kumar-McW hat das vor 5 Tagen übernommen. Offenbug bug_feature_triaged mojo-stdlib Team: Mojo Libraries
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
modular/modular#7658 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug bug_feature_triaged mojo Team: Mojo Libraries
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
modular/modular#7646 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in modular/modular
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
sagemathinc/sagebrush#1683 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
baseballyama/rsvelte#5235 ·
Maintainer antworten meist innerhalb von 1 Tag
-
lang-core: member access on a component instance reads its internal fields instead of giving nullOffenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
midspiral/LemmaScript#355 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag