test(ad): GPU/packed-field AD parity for the exchange rules
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Start with test/enzyme_rules.jl, test/device.jl, and test/device_gpu.jl, then inspect the packed-field exchange entry points in src/packedfield.jl and src/transfer_kernels.jl. Add CPU packed-field AD coverage and GPU coverage under MFO_TEST_GPU, checking the declared gradient and ENZ_EXT.rule_hits(). Document whether GPU reverse mode is supported or refused.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
ext/MatrixFreeOperatorsEnzymeCoreExt.jl registers rules on _exchange_storage!/_bc_storage!, which are layout-agnostic: they take raw storage plus a BlockLayout tag, so PackedBlockField goes through the same rules as BlockField. That is the mechanism DESIGN.md §6 calls mandatory for @kernel-authored leaves — the packed GPU exchange must never be differentiated through, and now it structurally cannot be.
None of that is tested on a GPU. Specifically:
- No AD test uses a packed field at all, on any backend.
src/packedfield.jl:17-18still designatesBlockFieldas "the reference layout for AD". test/device.jl/test/device_gpu.jlnever differentiate, soMFO_TEST_GPU=trueadds no AD coverage.- The device exchange path (
_run_exchange!(::PackedBlockField, ...)insrc/transfer_kernels.jl:194-198) dispatches to batched kernels below the rule seam only when the backend is a real GPU. On CPU it falls back to_run_exchange_host!, which is what the current tests exercise — so the rule is verified against the fallback, not against the kernels.
What to add
- CPU-side first — the quick, self-contained first deliverable. It needs no hardware and can land as its own PR ahead of steps 2-3: a packed-field AD test asserting the gradient matches the declared adjoint and that the rules fire (
ENZ_EXT.rule_hits()counters increase across the call), mirroringtest/enzyme_rules.jl. - Under
MFO_TEST_GPU, the same against CUDA arrays — the real question being whether the rule's reverse body (_exchange_storage_adjoint!, which stays on host descriptor loops on all backends by design, seetransfer_kernels.jl:16-23) composes correctly with a forward pass that ran as batched kernels. - Decide and document whether GPU reverse mode is supported or explicitly refused. Right now it is neither — it is untested.
—
🤖 Claude fixed a line number that had wandered off.
claude-opus-5-5[1m] (high) · claude-code 2.1.285 · unreviewed
- Lenguaje dominante
- Julia
- Estrellas
- 3
- Forks
- 1
- Merge medio
- 23 h 5 min
- PR fusionados (30 d)
- 16
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 RallypointOne/MatrixFreeOperators.jl
-
Roadmap: open-issue priorityAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
RallypointOne/MatrixFreeOperators.jl#109 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
RallypointOne/MatrixFreeOperators.jl#108 ·
Los mantenedores suelen responder en 1 día
-
performance
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
RallypointOne/MatrixFreeOperators.jl#94 ·
Los mantenedores suelen responder en 1 día
-
perf(forest): thread the reference BlockForest path — leaf sweeps and exchange descriptor loopsAbiertoperformance
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
RallypointOne/MatrixFreeOperators.jl#83 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
RallypointOne/MatrixFreeOperators.jl#82 ·
Los mantenedores suelen responder en 1 día
Todos los issues de RallypointOne/MatrixFreeOperators.jl
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
EnzymeAD/ReactantServer.jl#103 ·
Los mantenedores suelen responder en 1 día
-
debye_length: strong_zero drops the permittivity's composition dependence from κ derivativesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ClapeyronThermo/Clapeyron.jl#649 ·
-
Add DocStringExtensionsAbiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
ohno/Antique.jl#165 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
JuliaLang/LinearAlgebra.jl#1749 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100