🐛[BUG]: AeroJEPA ignores unbatched TokenSet masks and decode_field_chunked accepts invalid arguments
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- machine-learning
Direzione di ricerca
Inizia con PrototypeTokenJEPAHead, QueryTokenDecoder, pad_token_sets e flatten_valid_token_features in physicsnemo.experimental.models.aerojepa e nel suo modulo layers; traccia come vengono gestite le maschere non batchate e gli argomenti del decoder chunked. Esegui i test test_decode_field_chunked_* del PR collegato, quindi aggiungi o esegui la coverage per TokenSets mascherati, valori di precision e dimensioni dei chunk non valide, e query_sdf=None, finché gli input non validi non falliscono chiaramente e le maschere valide vengono preservate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version
2.3.0a0 (main at 3bbbe86a)
On which installation method(s) does this occur?
Source
Describe the issue
Two groups of input-handling problems in the experimental AeroJEPA model (physicsnemo.experimental.models.aerojepa). None of them raise an error; they give wrong results or cryptic failures.
1. The mask of an unbatched TokenSet is ignored. QueryTokenDecoder.forward drops masked-out target tokens, but three other components treat every token of an unbatched TokenSet as valid:
PrototypeTokenJEPAHeadbuilds an all-Truecontext mask for unbatched input, so masked-out context tokens still take part in cross-attention. The batched path usescontext_tokens.maskcorrectly.pad_token_setssetsmask[i, :count] = Trueand computes the fallback global token withmasked_mean(features, None). Tokens that the input set marks invalid become valid after packing, and they also enter the global token.flatten_valid_token_featuresreturns rank-2 features unchanged even when a mask is passed.
Expected: masked-out tokens are excluded in every case, as they already are in the batched path.
2. AeroJEPA.decode_field_chunked does not check its arguments.
- An unknown
precision(for example"bfloat16"or"amp") falls back to fp32 without any warning. The docstring says "Anything other than"fp32"enablestorch.autocast", but the code only enables autocast for"fp16"and"bf16". chunk_size <= 0fails inside the decoder withtorch.cat(): expected a non-empty list of Tensors.query_sdfis required, even thoughdecode_fieldand the decoder acceptNonewhenuse_sdf=False. Omitting it raisesTypeError: 'NoneType' object is not subscriptable.- The same goes for
QueryTokenDecoder(query_chunk_size=0): the constructor accepts it, andforwardthen fails withrange() arg 3 must not be zero.
Expected: invalid arguments raise a clear ValueError, and query_sdf is optional when the decoder does not use it.
Minimum reproducible example
import torch
from physicsnemo.experimental.models.aerojepa import (
PrototypeTokenJEPAHead, QueryTokenDecoder, TokenSet,
)
from physicsnemo.experimental.models.aerojepa.layers import (
flatten_valid_token_features, pad_token_sets,
)
head = PrototypeTokenJEPAHead(
token_dim=16, cond_dim=0, depth=1, num_heads=2, neighbor_k=4, query_pe_bands=2
).eval()
feats, coords, targets = torch.randn(10, 16), torch.randn(10, 3), torch.randn(5, 3)
mask = torch.arange(10) < 6
with torch.no_grad():
trimmed = head(context_tokens=TokenSet(feats[:6], coords[:6]), target_positions=targets)
masked = head(context_tokens=TokenSet(feats, coords, mask=mask), target_positions=targets)
print(torch.allclose(trimmed, masked, atol=1e-5)) # False
packed = pad_token_sets([TokenSet(feats, coords, mask=mask)])
print(int(packed.mask.sum())) # 10, expected 6
print(flatten_valid_token_features(feats, mask).shape[0]) # 10, expected 6
QueryTokenDecoder(token_dim=16, use_sdf=False, query_chunk_size=0) # accepted
For decode_field_chunked, run test_decode_field_chunked_* from the linked PR against main.
Relevant log output
precision='bfloat16' : accepted, autocast enabled=False
chunk_size=0 : ValueError: torch.cat(): expected a non-empty list of Tensors
query_sdf=None : TypeError: 'NoneType' object is not subscriptable
query_chunk_size=0 : ValueError: range() arg 3 must not be zero
Environment details
Bare-metal, source install (uv, editable), Python 3.12.3, torch 2.14.0+cpu, Linux aarch64
- Lingua principale
- Python
- Stelle
- 3.4k
- Fork
- 824
- Merge medio
- 3g 4h
- PR unite (30g)
- 70
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NVIDIA/physicsnemo
-
Wasserstein CDF distance uses the first width for every binForse già presa @sylvesterkaczmarek l’ha presa 21 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
NVIDIA/physicsnemo#2042 ·
I maintainer di solito rispondono entro 2 giorni
-
🐛[BUG]: Darcy2D Jacobi kernel divides grad(k)·grad(u) by 2dx instead of 4dx², so the data doesn't solve the Darcy equationForse già presa @coreyjadams l’ha presa 19 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NVIDIA/physicsnemo#2036 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
🐛[BUG]: MHD_PDE equation "B_grad_u" uses v * Bx.diff(y) instead of By * u.diff(y)Forse già presa @aaguadob l’ha presa 27 giorni fa. Aperta? - Needs Triage bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
NVIDIA/physicsnemo#2021 ·
I maintainer di solito rispondono entro 2 giorni
-
🐛[BUG]: Diffusion(time=True) in darcy_physics_informed/utils.py silently drops the time-derivative termForse già presa @aaguadob l’ha presa 27 giorni fa. Aperta? - Needs Triage bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
NVIDIA/physicsnemo#2020 ·
I maintainer di solito rispondono entro 2 giorni
-
🐛[BUG]: DistributedManager's SLURM setup connects to the srun launch node, not to rank 0's nodeForse già presa @peterdsharpe l’ha presa oggi. Aperta? - Needs Triage bug
NVIDIA/physicsnemo#2168 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di NVIDIA/physicsnemo
Issue simili
-
Project submission:Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
slavakurilyak/awesome-ai-agents#845 ·
I maintainer di solito rispondono entro 1 giorno
-
tests: pin that the atomic writers in utils/paths.py stage the temporary file in the target's directoryForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertadifficulty:2 enhancement good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
MakazhanAlpamys/Soup#2178 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] dcg.waggr permutation p-values are folded twice, so near-zero scores get the smallest p-valuesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
scverse/rapids-singlecell#854 ·
I maintainer di solito rispondono entro 1 giorno
-
Slang input: int8_t4_packed and uint8_t4_packed are copied into CrossGLForse già presa @ninglinLiu l’ha presa 1 giorno fa. Apertaarea:frontend backend:slang bug direction:input
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
random_elements(unique=True) on an OrderedDict: ZeroDivisionError once only zero weights remain, AssertionError with use_weighting=FalseForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 13 giorni