Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
f560256
init llm astra
gkarfakis19 Nov 1, 2025
d6d7893
fix submodule
gkarfakis19 Nov 2, 2025
629c02b
updated astra ver
gkarfakis19 Nov 2, 2025
7b019de
updated config to handle new astra ver
gkarfakis19 Nov 2, 2025
9b324a5
Some cleanup and fixed major network double counting flattened bug
gkarfakis19 Nov 2, 2025
75c2ee4
time calc refactor stage 1
gkarfakis19 Nov 2, 2025
4f0a3c4
first stage config update. Astrasim integration missing, everything e…
gkarfakis19 Nov 2, 2025
b79cf26
minor fix
gkarfakis19 Nov 2, 2025
f8834f8
small config cleanup
gkarfakis19 Nov 2, 2025
9dc7656
Major reformat of network configs to enable N-dimensional astrasim ex…
gkarfakis19 Nov 3, 2025
fd1a137
enabled multi dim network for non-flattened exec modes
gkarfakis19 Nov 3, 2025
88eba5b
added network prints, fixed hierarchical context parallelism
gkarfakis19 Nov 4, 2025
bfdd900
remap send and recv nodes for more astrasim stability
gkarfakis19 Nov 4, 2025
3557dcf
bugfix
gkarfakis19 Nov 4, 2025
35eb723
faulty links enabled w/ new astra ver
gkarfakis19 Nov 4, 2025
62aa31c
memory estimation enabled and flash attention supported
NanoMembers Nov 4, 2025
03b505e
sweep updates
gkarfakis19 Nov 5, 2025
a222bd1
small fix
gkarfakis19 Nov 5, 2025
1543389
synthetic duplication fix
gkarfakis19 Nov 5, 2025
13fc174
mem awareness
gkarfakis19 Nov 5, 2025
fae70d5
modified memory estimation to pipedream style and microbatch 1 assump…
NanoMembers Nov 6, 2025
7173632
enabled memory estimation with gradient accumulation considered
NanoMembers Nov 6, 2025
864d1d5
bug fix for hybrid mode
NanoMembers Nov 6, 2025
d733edb
added many tools + step 1 of 'proper' faulty link support.
gkarfakis19 Nov 6, 2025
bf3c073
hierarchical mode faults enabled after large reorganization of transf…
gkarfakis19 Nov 7, 2025
99681a6
Support no-DP graph generation for gradient-accumulation timing
NanoMembers Nov 7, 2025
a661557
implemented DP faults (harder than I thought)
gkarfakis19 Nov 8, 2025
10d4ac1
gmap optimize 2D topologies implemented (not tested)
gkarfakis19 Nov 8, 2025
b7f519a
enabled pipeline parallelism for non-divisor num layers/pp
gkarfakis19 Nov 9, 2025
adf3d29
removed network/system cache functionality for astrasim integration t…
gkarfakis19 Nov 9, 2025
e733920
fixed many configs
gkarfakis19 Nov 9, 2025
b9cd28d
added pytest, fixed hybrid/hierarchical bug
gkarfakis19 Nov 11, 2025
b4f75d7
small fix
gkarfakis19 Nov 11, 2025
65de98a
implemented expert parallelism
NanoMembers Nov 9, 2025
6139dea
flash attention forward and backward implemented
NanoMembers Nov 10, 2025
7c57274
minor clean up and fix
NanoMembers Nov 11, 2025
7db2824
attempt to add CI
gkarfakis19 Nov 16, 2025
02abd95
minor fix
gkarfakis19 Nov 16, 2025
65bdd6c
dependencies for CI
gkarfakis19 Nov 16, 2025
acd157d
test if CI fails
gkarfakis19 Nov 16, 2025
72ff52e
revert test if CI fails
gkarfakis19 Nov 16, 2025
a359b16
Add NVIDIA validation tests and update validation helpers for inferen…
NanoMembers Nov 18, 2025
6c387cd
Fix L2 capacity assignment in TiledGEMM class
NanoMembers Nov 18, 2025
2460968
Add AccessBytes class and update memory access calculations in TimeCa…
NanoMembers Nov 18, 2025
dcdf1ec
Consider SM utilization based on wave calculation method
NanoMembers Nov 18, 2025
432c9e9
Adjust inference run checks in TimeCalculation
NanoMembers Nov 18, 2025
afdb731
Split validation tests into A100 and H100 devices and update data han…
NanoMembers Nov 18, 2025
6e65787
Mark IMEC H100 test for failure
NanoMembers Nov 18, 2025
7ce961a
multithreaded and cleaner per device-model tests
gkarfakis19 Nov 21, 2025
0796c9b
doubled num tests
gkarfakis19 Nov 21, 2025
5fbb468
separated val configs
gkarfakis19 Nov 21, 2025
0e88891
WIP train test
gkarfakis19 Nov 21, 2025
22bef8f
added full train validation script based on IMEC data. Test is commen…
gkarfakis19 Nov 22, 2025
b87b2ec
added optimizer FLOPS to bwd pass, big cleanup of timing and comm rul…
gkarfakis19 Nov 23, 2025
0d065cd
minor fix
gkarfakis19 Nov 23, 2025
e5e023c
removed vestigial code
gkarfakis19 Nov 23, 2025
82351da
minor weird bug fix with wrong network analyitc gen
gkarfakis19 Nov 23, 2025
6591357
implemented full recomputation for hybrid/hierachical mode
NanoMembers Nov 23, 2025
0ce7b9d
Revert "implemented full recomputation for hybrid/hierachical mode"
bingluc Nov 24, 2025
9d1105c
new style astrasim config gen by Faraz
gkarfakis19 Nov 25, 2025
4360457
disaggregated MHA always. needed for next hidden comm refinements
gkarfakis19 Nov 25, 2025
9b96b87
added zero 3 inference check
gkarfakis19 Nov 25, 2025
d1a55b5
first attempt at split comm/comp. passes all tests, reduces worst cas…
gkarfakis19 Nov 25, 2025
ccb03eb
implemented full recomputation for hybrid/hierachical mode
NanoMembers Nov 23, 2025
7a11378
implemented full-recomputation for all modes with pipeline style reco…
NanoMembers Nov 26, 2025
bc2fee5
small update to faraz config parser
gkarfakis19 Nov 26, 2025
1ec4310
updated astrasim??
gkarfakis19 Nov 26, 2025
536b764
annoying error. hopefully this fixes it.
gkarfakis19 Nov 26, 2025
8988127
added dp microbatch sync option to fix selene tests. nvidia train tes…
gkarfakis19 Dec 5, 2025
0a2a12f
added scotchpy to reqs txt
gkarfakis19 Dec 5, 2025
e593045
Plot GEMM operation comparison
NanoMembers Dec 5, 2025
2c63cff
added uci train tests validation
gkarfakis19 Dec 5, 2025
90b562c
Disable SM util for flash attention
NanoMembers Dec 5, 2025
980dad0
fixed mapping
gkarfakis19 Dec 6, 2025
d4977ad
gitignore up
gkarfakis19 Dec 15, 2025
0acc83c
changed configs for 2d topo
gkarfakis19 Dec 15, 2025
7fcca22
fix
gkarfakis19 Dec 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
push:
branches:
- main
- llm-dev
pull_request:

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install AstraSim system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
gcc-11 g++-11 make cmake \
clang-format \
libboost-dev libboost-program-options-dev \
libprotobuf-dev protobuf-compiler \
openmpi-bin openmpi-doc libopenmpi-dev

- name: Install uv
uses: astral-sh/setup-uv@v2

- name: Sync Python dependencies
run: uv sync

- name: Determine AstraSim commit
run: echo "ASTRASIM_SHA=$(git -C astra-sim rev-parse HEAD)" >> $GITHUB_ENV

- name: Restore AstraSim build cache
id: ascache
uses: actions/cache@v4
with:
path: astra-sim/build/astra_analytical/build
key: astra-${{ env.ASTRASIM_SHA }}

- name: Build AstraSim (cache miss)
if: steps.ascache.outputs.cache-hit != 'true'
run: |
chmod +x scripts/install_astrasim.sh
scripts/install_astrasim.sh

- name: Run pytest
env:
DEEPFLOW_VALIDATION_WORKERS: "1"
run: uv run pytest
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
*.swp
*.swo
.cursor/
__pycache__/
output/
venv/
astra_cache/
log/*.log
tmp/
tmp/
output*/
dbg_hw_conf/
tools/fault_sweep_results*
tools/*.png
tools/*.tsv
tools/*.json
tools/gmap_artifacts/
*.md
*.et
tools/comp/wrapper_outputs/*
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "astra-sim"]
path = astra-sim
url = https://github.com/gkarfakis19/astra-sim
[submodule "extern/graph_frontend/param"]
path = extern/graph_frontend/param
url = https://github.com/facebookresearch/param.git
12 changes: 12 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
DeepFlow quick brief for future agents

- Purpose: Python simulator for LSTM/GEMM/LLM performance, memory, and (rudimentary) energy. Entry point `run_perf.py` loads YAML configs (hardware + model) and builds compute/comm graphs, then simulates analytically or via AstraSim.
- Execution backends (set in hardware config `execution_backend`): analytical (ring-only, no congestion); hybrid (AstraSim for transformer block graph, analytical pipeline); full_astrasim_hierarchical (AstraSim separately for transformer and pipeline graphs, assumes no congestion between them); full_astrasim_flattened (one big combined graph in AstraSim, slowest/most detailed).
- Parallelism model: supports DP, TP (+optional sequence parallel), CP, GPipe-style pipeline (`lp` stages), and hybrid TP+CP. Pipeline graph assumes uniform per-layer timing and GPipe scheduling; gradient accumulation builds a no-DP variant so only the last accumulation step does DP all-reduce.
- Communication assumptions: blocking collectives; analytical path uses ring formulas; AstraSim collectives flatten 2D topologies to 1D for collectives. Hierarchical mode requires the first active network dimension map exactly to {tp,cp}; non-ring topologies are rejected in analytical mode. Faulty links only valid in full AstraSim modes.
- ZeRO assumptions: stage 0/1 ≈ DDP; stage 2 adds per-layer param AG + grad RS sizes; stage 3 adds per-layer param materialization (counted as comm + ephemeral memory, no overlap). MoE assumes perfect balance and TP all-to-all; multi-GPU MoE is WIP.
- Attention: dense by default. FlashAttention supported for training forward/prefill when `attention.use_flashattention=true` and tile size is set manually; decode path ignores FlashAttention. Sliding-window/MLA are WIP.
- Memory model: static formulas for activations/weights/optimizer; KV-cache memory estimation WIP. Peak memory compared to DRAM per device; ZeRO-3 ephemeral gather tracked separately. No fragmentation/eviction modeling.
- Inference: `TimeCalculationLLMInference` handles prefill + sampled decode steps (linear interpolation between samples). DP acts as replica multiplier only; CP decode is noted WIP. FlashAttention disabled for decode.
- Artifacts/logs: outputs under `output/` (mode subdir). AstraSim artifacts live in `astra_cache/` and optionally `output/LLM/astra_hier` or `astra_flat` when persistence flags are set. Current logs/marker: `log/this_folder_contains_astrasim_logs`, `log/log.log` hold prior runs. Debug hardware snapshots in `dbg_hw_conf/20251105_173209/` (e.g., `baseline_001_tp64_cp1_dp1_lp1.yaml`, `baseline_053_tp1_cp1_dp64_lp1.yaml`).
- Key environment flags: `DEEPFLOW_VISUALIZE_GRAPHS`, `DEEPFLOW_PERSIST_ASTRASIM_ARTIFACTS`, `DEEPFLOW_PERSIST_ARTIFACT_VIZ`, `DEEPFLOW_ASTRA_CACHE_MODE` (default CACHE_READWRITE).
Loading
Loading