mstar.model.pi05.components.paligemma#
PaliGemma transformer expert for Pi0.5 (prefix processing).
A Gemma-style transformer that writes the paged KV cache through the node’s KV/attention/position resources. Used for the prefill graph walk where it processes the prefix tokens (image + language + state) and writes the KV cache that the action expert later reads during action generation.
Composed entirely from mstar.model.components — Gemma RMSNorm
(gemma_mode=True), GELU-tanh ParallelGatedMLP, and a standard
ParallelAttention block (with a trivial single-rank comm group for
the non-TP case, so the same code runs for TP=1 and TP>1).
Classes
|
Stack of PaliGemma transformer layers. |
- class mstar.model.pi05.components.paligemma.Pi05PaliGemmaExpert(config)[source]#
Bases:
ModuleStack of PaliGemma transformer layers.
The submodule’s input embeddings (image tokens + language tokens + state tokens) are passed in directly. This module owns only the transformer blocks plus a final Gemma RMSNorm; the embedding table is held by the parent submodule and shared with the action expert.
- Parameters:
config (Pi05Config)
- forward(query_sequence, *, label)[source]#
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.