Experimental PIM-HBM Hardware Co-Design Subsystem exploring 0ns Framework Memory View Fusion & Fault Telemetry
This project is a hardware-software co-design prototype engineered to investigate and resolve software abstraction fragmentation barriers within next-generation accelerator infrastructure environments.
By interlocking the low-level physical cache-line alignment mechanisms directly with the upper high-performance framework (JAX/XLA) address interfaces into a unified algebraic pipeline, this subsystem explores the structural viability of stably mitigating static compilation stalls and hardware timing jitters during distributed cluster operations.
0ns Memory Copy Bypass: Leverages the__cuda_array_interface__
specification to directly link low-level C++ physical address lines to the JAX tensor bus, structurally eliminating host-device hardware memory copy overhead.Pure Branchless Loop: Completely eradicates conditional branches (if
), instead deploying precise ternary operations and register-resident data reuse patterns to guarantee the compiler forces conditional move primitives (SEL/PRMT
).Warp-level Dynamic Bounds: Intercepts potential out-of-bound memory faults (SegFault
) inside ragged tail grids by driving a warp-level binary tree reduction firewall via__shfl_down_sync
to compute active maximum surviving address offsets.Algebraic Insulation Gate: Captures hardware fault signals and floating-point divergence anomalies behind the JAX runtime using dedicatedstop_gradient
circuits, isolating backpropagation chain contamination at the physical layer.Dynamic Hot-Plugging Recovery: Upon physical HBM bank failure during active cluster runs, this mechanism attempts real-time 64-bit address wire hot-swapping for the corrupted device slot without causing collective communication (NCCL) stalls or graph recompilation.
: Declares legal safeguards and patent retaliation defense clauses under the Apache License 2.0 specification.LICENSE
: The build orchestrator that automatically tracks system hardware architecture topologies andCMakeLists.txt
pybind11
compilation paths to emit the final shared object (.so
) libraries.: The core branchless mathematical acceleration kernel implementingpim_hbm_core.cu
alignas(32)
cache-line matching,__activemask()
dynamic address firewalls, and__ldg
high-speed read rails (C++/CUDA).: The pre-warming and backpropagation chain insulation layer utilizingpim_hardware_gate.py
ShapeDtypeStruct
virtual abstract tracers to lock XLA compiler machine code while maintaining 0MB of physical VRAM footprint (Python/JAX).: The macro-level topology control tower that intercepts per-node VRAM physical address lines to establish zero-copytopology_sharding.py
NamedSharding
global distributed matrix views (Python/JAX).: The real-time, high-availability hot-plugging swap engine that handles background fault scans within the distributed weight matrices and switches routing to the pre-reserved emergency backup address pool (Python/JAX).hardware_fault_recovery.py
: The collective scanning and recovery engine engineered for large-scale infrastructure, leveraging wire-level NCCL All-Reduce fusion andhardware_fault_recovery_distributed.py
np.flatnonzero
vectorized fault extraction (Python/JAX).: A transformer layer adapter plugin that conducts direct 0ns address ingestion matching Llama-3-8B dimensions (4096 / 14336) alongside branchless fault-tolerant forward execution buses (Python/JAX).llama3_layer_adapter.py
Execute the following commands sequentially within a high-performance cluster terminal configured with NVIDIA Ampere (A100) or Hopper (H100/H200) environments to ignite the memory view fusion mode and the hardware fault-tolerant emulation engine.
mkdir build && cd build
cmake ..
make -j\$(nproc)
cp pim_hbm_bridge_core*.so .. && cd ..
python3 pim_hardware_gate.py
python3 topology_sharding.py
python3 hardware_fault_recovery_distributed.py
python3 llama3_layer_adapter.py
This project is distributed under the terms of the Apache License 2.0. You are free to modify and distribute the software, provided that the original copyright notice and license disclosure obligations are fully preserved.
Experimental PIM-HBM Hardware Co-Design Subsystem exploring 0ns Framework Memory View Fusion & Fault Telemetry
๋ณธ ํ๋ก์ ํธ๋ ์ฐจ์ธ๋ ๊ฐ์๊ธฐ ์ธํ๋ผ ํ๊ฒฝ์์ ๋ฐ์ํ ์ ์๋ ์ํํธ์จ์ด ๊ณ์ธต ๊ฐ ํํธํ ์ฅ๋ฒฝ์ ์ฐ๊ตฌํ๊ธฐ ์ํด ์ค๊ณ๋ ํ๋์จ์ด-์ํํธ์จ์ด ๊ณต๋ ์ค๊ณ(Co-design) ํ๋กํ ํ์ ์ ๋๋ค.
์ ์์ค์ ๋ฌผ๋ฆฌ ์บ์๋ผ์ธ ์ ๋ ฌ ๋งค์ปค๋์ฆ๊ณผ ์์ ๊ณ ์ฑ๋ฅ ํ๋ ์์ํฌ(JAX/XLA) ๊ฐ์ ์ฃผ์์ ์ธํฐํ์ด์ค๋ฅผ ๋จ์ผ ๋์ ํ์ดํ๋ผ์ธ์ผ๋ก ์ฐ๊ฒฐํ์ฌ, ๋ถ์ฐ ํด๋ฌ์คํฐ ๊ฐ๋ ์ค ์ ๋ฐ๋๋ ์ ์ ์ปดํ์ผ ๋ ๋ฐ ํ๋์จ์ด ์งํฐ๋ฅผ ์์ ์ ์ผ๋ก ์ ์ดํ ์ ์๋ ๊ฐ๋ฅ์ฑ์ ํ๊ตฌํฉ๋๋ค.
0ns Memory Copy Bypass:__cuda_array_interface__
๊ท๊ฒฉ์ ํ์ฉํด C++ ๊ธฐ๊ณ์ด ์ฃผ์์ ์ JAX ํ
์ ๋ฒ์ค์ ์ง๊ฒฐํจ์ผ๋ก์จ, ํธ์คํธ-๋๋ฐ์ด์ค ๊ฐ ๋ฌผ๋ฆฌ ๋ณต์ฌ ์ค๋ฒํค๋๋ฅผ ๊ตฌ์กฐ์ ์ผ๋ก ํด์ํฉ๋๋ค.Pure Branchless Loop: ์กฐ๊ฑด ๋ถ๊ธฐ๋ฌธ(if
)์ ์์ ํ ๋ฐฐ์ ํ๊ณ ์ผํญ ์ฐ์ฐ ๋ฐ ๋ ์ง์คํฐ ์์ฃผ ๋ฐ์ดํฐ ์ฌ์ฌ์ฉ ๊ตฌ์กฐ๋ฅผ ์ ๋ฐ ๊ตฌ์ฑํ์ฌ, ์ปดํ์ผ๋ฌ ์์ค์ ์กฐ๊ฑด๋ถ ์ด๋ ๋ช
๋ น์ด(SEL/PRMT
) ์ถ๋ ฅ์ ์ ๋ํฉ๋๋ค.Warp-level Dynamic Bounds: ๋ง์ง๋ง ๊ทธ๋ฆฌ๋ ์ํฌ๋ฆฌ ์์ญ์์ ๋ฐ์ํ ์ ์๋ ๋ฉ๋ชจ๋ฆฌ ์ฐธ์กฐ ์ค๋ฅ(SegFault)๋ฅผ ๋ฐฉ์งํ๊ธฐ ์ํด,__shfl_down_sync
๊ธฐ๋ฐ ์ํ ๋ด 2์ง ํธ๋ฆฌ ์ต๋ ์์กด ์ฃผ์ ๋์ ๋ฆฌ๋์
๋ฐฉํ๋ฒฝ์ ๊ตฌ๋ํฉ๋๋ค.Algebraic Insulation Gate: JAX ๋ฐํ์์์ ํ๋์จ์ด ๊ฒฐํจ ์ ํธ ๋ฐ ์์น ๋ฐ์ฐ ์ค์ฐจ๋ฅผstop_gradient
ํ๋ก๋ก ํฌํํ์ฌ, ๋ฏธ๋ถ ์ฌ์ฌ ์ค์ผ์ ํผ์ง์ปฌ ๋ ๋ฒจ์์ ๊ฒฉ๋ฆฌ ๋ฐ ์ ์ฐํฉ๋๋ค.Dynamic Hot-Plugging Recovery: ๊ฐ์๊ธฐ ํด๋ฌ์คํฐ ๊ตฌ๋ ์ค ํน์ HBM ๋ฑ ํฌ์ ๋ฌผ๋ฆฌ์ ๊ฒฐํจ ๋ฐ์ ์, ๊ธ๋ก๋ฒ ํต์ (NCCL) ์ค๋จ ๋ฐ ๊ทธ๋ํ ์ฌ์ปดํ์ผ ์์ด ์ค์ง ๋ถ๋ ์ฅ์น์ 64๋นํธ ์ฃผ์์ ๋ง ์ค์๊ฐ์ผ๋ก ์ฐํ ์ค์ํ(Hot-Swapping)ํ๋ ๋ฉ์ปค๋์ฆ์ ์๋ํฉ๋๋ค.
: Apache License 2.0 ์๊ฑฐ ๋ฒ์ ๋ฐฉํ๋ฒฝ ๋ฐ ํนํ ๋ณดํธ ์กฐํญ ๋ช
์LICENSE
: ์์คํ
๊ฐ์๊ธฐ ์ํคํ
์ฒ ํ๊ฒฝ๊ณผCMakeLists.txt
pybind11
์ปดํ์ผ ํจ์ค๋ฅผ ์๋ ์ถ์ ํ์ฌ ๊ณต์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ(.so
)๋ฅผ ์ฌ์ถํ๋ ๋น๋ ์ค์ผ์คํธ๋ ์ดํฐ:pim_hbm_core.cu
alignas(32)
์บ์๋ผ์ธ ์ผ์น ๋ ์ด์์,__activemask()
๋์ ์ฃผ์ ๋ฐฉํ๋ฒฝ ๋ฐ__ldg
๊ฐ์ ๋ ์ผ์ด ์ฃผ์
๋ ๋ฌด๋ถ๊ธฐ ์ํ ๊ฐ์ ์ปค๋ ์ฝ์ด (C++/CUDA):pim_hardware_gate.py
ShapeDtypeStruct
๊ฐ์ ์ถ์ํ ํธ๋ ์ด์๋ฅผ ํ์ฉํด ์ค์ฌ VRAM ์ ์ 0MB ์ํ๋ก XLA ์ปดํ์ผ๋ฌ ๊ธฐ๊ณ์ด๋ฅผ ๊ณ ์ ํ๋ ์์ด ๋ฐ ๋ฏธ๋ถ ์ฌ์ฌ ์ ์ฐ ๋ ์ด์ด (Python/JAX): ๋๊ท๋ชจ ํด๋ฌ์คํฐ ๋
ธ๋๋ณ VRAM ๋ฌผ๋ฆฌ ์ฃผ์์ ์ ๊ฐ๋ก์ฑ์ด ์ ๋ก์นดํผtopology_sharding.py
NamedSharding
๊ธ๋ก๋ฒ ๋ถ์ฐ ๋งคํธ๋ฆญ์ค ๋ทฐ๋ฅผ ์๋ฆฝํ๋ ๊ฑฐ์์ ํ ํด๋ก์ง ๊ด์ ํ (Python/JAX): ๋ถ์ฐ ๊ฐ์ค์น ํ๋ ฌ ๋ด ๋ถ๋ ๋ฑ
ํฌ ๋ฐฑ๊ทธ๋ผ์ด๋ ์ค์บ ๋ฐ ๋น์ ๋ฐฑ์
ํ ์ฃผ์์ ์ ํ์ฉํ ์ค์๊ฐ ๋ฌด์ค๋จ ํซํ๋ฌ๊น
์ค์ํ ์์ง (Python/JAX)hardware_fault_recovery.py
: ์ด๋ํ ์ธํ๋ผ๋ฅผ ์ํ NCCL All-Reduce ์์ด์ด ๋ ๋ฒจ ์ตํฉ ์ง์ฐ(Collective) ์ค์บ ๋ฐhardware_fault_recovery_distributed.py
np.flatnonzero
๋ฒกํฐํ ๊ฒฐํจ ์ ์ถ ๋ณต๊ตฌ ์์ง (Python/JAX): Llama-3-8B ๊ณ ์ ์ฐจ์(4096 / 14336) ์งํต 0ns ์ฃผ์ ์ธ์
๋ฐ ๋ฌด๋ถ๊ธฐ ๊ฒฐํจ ํ์ฉ ์๋ฐฉํฅ ํ๋ จ/์ถ๋ก ๋ฒ์ค ์ด๋ํฐ ํ๋ฌ๊ทธ์ธ (Python/JAX)llama3_layer_adapter.py
NVIDIA Ampere(A100) ๋๋ Hopper(H100/H200) ํ๊ฒฝ์ด ๊ตฌ์ถ๋ ๊ณ ์ฑ๋ฅ ํด๋ฌ์คํฐ ํฐ๋ฏธ๋์์ ๋ค์ ๋ช ๋ น์ ์์ฐจ ๊ฐ๋ํ์ฌ ๋ฐ์ดํจ์ค ๋ชจ๋ ๋ฐ ํ๋์จ์ด ๊ฒฐํจ ํ์ฉ(Fault-Tolerant) ์์ง ์๋ฎฌ๋ ์ด์ ์ ๊ธฐํญํ ์ ์์ต๋๋ค.
mkdir build && cd build
cmake ..
make -j\$(nproc)
cp pim_hbm_bridge_core*.so .. && cd ..
python3 pim_hardware_gate.py
python3 topology_sharding.py
python3 hardware_fault_recovery_distributed.py
python3 llama3_layer_adapter.py
๋ณธ ํ๋ก์ ํธ๋ Apache License 2.0 ์๊ฑฐํ์ฌ ๋ฐฐํฌ๋ฉ๋๋ค. ์์ ๋ก์ด ์์ ๋ฐ ๋ฐฐํฌ๊ฐ ๊ฐ๋ฅํ๋ ์ ์๊ถ ๋ฐ ๋ผ์ด์ ์ค ๊ณ ์ง ์๋ฌด๊ฐ ์๋ฐ๋ฉ๋๋ค.