File size: 1,492 Bytes
ab447b7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# SPDX-FileCopyrightText: © 2025 Tenstorrent USA, Inc.
# SPDX-License-Identifier: Apache-2.0

"""
PI0 Reference Implementation - Pure PyTorch modules.

All modules in this folder are pure PyTorch implementations used as
ground truth for PCC (Pearson Correlation Coefficient) testing.

Modules:
    - torch_gemma: GemmaAttention, GemmaMLP, GemmaBlock
    - torch_siglip: SigLIPAttention, SigLIPMLP, SigLIPBlock, SigLIPVisionTower
    - torch_prefix: PrefixEmbedding
    - torch_suffix: SuffixEmbedding
    - torch_paligemma: PaliGemmaBackbone
    - torch_denoise: DenoisingModule, KVCacheManager
    - torch_pi0_model: PI0Model
"""

# Gemma components
from models.experimental.pi0.reference.torch_gemma import (
    GemmaAttention,
    GemmaMLP,
    GemmaBlock,
    rms_norm,
    precompute_freqs_cis,
)

# SigLIP components
from models.experimental.pi0.reference.torch_siglip import (
    SigLIPAttention,
    SigLIPMLP,
    SigLIPBlock,
    SigLIPVisionTower,
    PatchEmbedding,
    MultiModalProjector,
)

# Prefix/Suffix embeddings
from models.experimental.pi0.reference.torch_prefix import PrefixEmbedding
from models.experimental.pi0.reference.torch_suffix import SuffixEmbedding

# PaliGemma backbone
from models.experimental.pi0.reference.torch_paligemma import PaliGemmaBackbone

# Denoising
from models.experimental.pi0.reference.torch_denoise import (
    DenoisingModule,
    KVCacheManager,
)

# Full model
from models.experimental.pi0.reference.torch_pi0_model import PI0Model