[BUG][intel:xe2] shuffle_down of a local variable returns the lane's own value across the warp boundary
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 22/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Mojo
- Estrellas
- 30.2k
- Forks
- 3.2k
- Merge medio
- 6 d 20 h
- PR fusionados (30 d)
- 25
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de modular/modular
-
bug_feature_triaged Team: Mojo Libraries
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
[BUG]Incomplete Apache LicenseAbiertobug bug_feature_triaged documentation mojo
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
Los mantenedores suelen responder en 2 días
-
`Counter.lt()` and `Counter.gt()` disagree with `__eq__`, and `a.lt(a)` can be `True`Posiblemente ocupada @YidaWeng la tomó hace 2 días. Abiertobug_feature_triaged Team: Mojo Libraries
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
modular/modular#7696 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
[BUG] `Counter` `-=`, `+=` and `&=` leave keys behind when they remove many keysPosiblemente ocupada @Tharun-Kumar-McW la tomó hace 5 días. Abiertobug bug_feature_triaged mojo-stdlib Team: Mojo Libraries
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
modular/modular#7658 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
[BUG] exp(NaN) returns infAbiertobug bug_feature_triaged mojo Team: Mojo Libraries
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
modular/modular#7646 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
Todos los issues de modular/modular
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
sagemathinc/sagebrush#1683 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
baseballyama/rsvelte#5235 ·
Los mantenedores suelen responder en 1 día
-
lang-core: member access on a component instance reads its internal fields instead of giving nullAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
midspiral/LemmaScript#355 · 1 comentario ·
Los mantenedores suelen responder en 1 día