How paramind2025/can works
Project type & purpose (from README + tree)
Project type: research-grade PyTorch vision backbone implementation (CliffordNet / Clifford Algebra Network) with a training script and an optional compiled CUDA extension for acceleration.
Primary purpose: train/evaluate CliffordNet variants (e.g., Nano/Lite/Deep) on CIFAR-100 under a “modern recipe”, and benchmark two execution modes:
• Compatibility mode: pure PyTorch implementation
• High-performance mode: custom kernel packaged as clifford_thrust wheels (installed via pip), enabled via --enable_cuda
Key architectural “twist” worth diagramming: a Clifford Interaction layer that can dispatch to:
• a custom CUDA path (when clifford_thrust is installed and enabled), or
• a PyTorch fallback path
File structure into diagrammable components
Top-level files strongly suggest a compact repo organized by “script + model modules + utilities + optional native extension”:
• train.py
Orchestrator / entrypoint: argument parsing (--enable_cuda), dataset setup (CIFAR-100), training loop, evaluation, checkpoint/logging.
• model.py
Top-level model assembly: CliffordNet class, selection of variants via parameters (patch_size, embed_dim, depth, cli_mode, ctx_mode, etc.).
• networks.py
Network building blocks: stages/blocks, patch embedding, normalization, classifier head, drop path, etc. (whatever is factored out of model.py).
• gffn.py
• utils.py
Cross-cutting helpers: metrics, LR scheduling, augmentation, checkpointing, device selection, seed, etc.
• cuda/
• Prebuilt wheels: clifford_thrust-...whl
Native extension distribution artifact (binary).
• cuda/whl.md
Installation notes / compatibility constraints (RTX 4090, CUDA versions).
Extract “architecture requirements” from README (what must be shown)
• Two execution modes (accelerated vs pure PyTorch) and the fallback behavior
• Hardware/software constraints for accelerated mode (specific CUDA/Python versions; optimized for RTX 4090)
• The training usage path (python train.py ...)
• Model configuration knobs that meaningfully change compute graph:
• cli_mode (e.g., “full”)
• ctx_mode (“diff” vs “full”)
• shifts, depth, embed_dim, drop_path_rate
Artifacts (checkpoints, logs/metrics)
• User → train.py (CLI invocation; flags)
• train.py → Dataset loader (download/load/augment)
• train.py → Model construction (CliffordNet(...))
• Forward/backward: Model ↔ PyTorch Autograd
• Conditional: Model → clifford_thrust (only when enabled/available) → CUDA/GPU
• Outputs: train.py → checkpoints/logs
Focus: how CliffordNet is built and where the Clifford Interaction sits.
• Input image (CIFAR-100)
• Patch embedding / stem (because README exposes patch_size, embed_dim)
• Backbone blocks × depth
• Context builder (depends on ctx_mode: diff/full)
• Clifford Interaction Layer
• Dispatch:
• PyTorch implementation
• or clifford_thrust kernel
• (Optional) FFN / gFFN (controlled by “No-FFN” vs baseline/ablation)
• Residual / norm / drop path (since drop_path_rate is exposed)
• Pooling / classifier head
• Dataflow through blocks
• A *branch* inside Clifford Interaction showing the accelerated vs fallback path
Focus: runtime sequencing, not static structure.
• train.py orchestration
• Data pipeline
• Model forward
• Loss/metrics
• Optimizer/scheduler
• Checkpoint/logging
Show:
Periodic eval and checkpoint
These are the interactions that matter most for accuracy:
Mode selection & fallback
• --enable_cuda flag (from README)
• runtime check “is clifford_thrust installed?” (README: “code automatically handles fallback”)
Python ↔ Native boundary
• That the extension is a *binary wheel* (distribution artifact) loaded by Python.
• That the extension accelerates a specific operation (Clifford Interaction / geometric product).
Hardware dependency
• GPU is not just “compute”; it is a compatibility constraint (RTX 4090 optimized; compute capability mentioned). Put this as a note callout on the accelerated path.
Artifacts
• Checkpoints and logs are outputs; include filesystem as a node (even if not shown in tree).
Open each file and confirm the real boundaries
• Where is CIFAR-100 loaded? (in train.py or utils.py)
• Where is the CUDA extension imported? (likely in networks.py or a dedicated op wrapper)
• What is the exact class/function name for the interaction layer?
Reflect reality, not intention
• If gffn.py is unused in current CIFAR experiments, mark it “optional/ablation”.
Annotate key configuration parameters at the component they affect
• ctx_mode next to Context Builder
• cli_mode next to Clifford Interaction
• drop_path_rate next to residual/drop path
Make the accelerated path unmissable
• conditional edge + hardware note + wheel artifact node.
• Iterative loop and the artifact outputs.