How asuan99/prefill-layer-alloc works
This repository is a research codebase for characterizing GPU execution of LLM attention/SSM workloads and evaluating multiplexing and serving policies. The main workflow configures model and sweep parameters, builds and measures GPU workloads, records latency/bandwidth and SM-scaling behavior, then analyzes results and renders figures. A separate engine-port area contains model implementations and multiplexing controllers; serving-eval provides a serving-focused evaluation branch. The README is empty, and several runners are unsampled, so those subsystems are represented without asserting unverified call paths.
Main entry points: kernels.py Kernel Builders · bw_probe.py Bandwidth Probe · decode_sm_scaling Decode Sweep · experiments Experiment Runners
Components 21
GPU Characterization
- Experiment Runners
workspace/characterization/experiments - Decode Sweep
workspace/characterization/decode_sm_scaling - Crossover Analysis
workspace/characterization/decode_crossover/compute_crossover.py - Kernel Builders
workspace/characterization/experiments/common/kernels.py - Bandwidth Probe
workspace/characterization/experiments/common/bw_probe.py - Wave Model
workspace/characterization/experiments/common/wave_model.py - Sweep Specification
workspace/shared/sweep_spec.py - Shared Loaders
workspace/shared/loaders.py - Layer Runner
workspace/characterization/src/models/layer_runner.py - Profiling Metrics
workspace/characterization/src/profiling/metrics.py - SM Controller
workspace/characterization/src/smctrl/green_ctx_controller.py
Serving Runtime
- Engine Models
workspace/engine-port/src/models - Multiplex Controller
workspace/engine-port/src/multiplex/controller.py - Runtime Profile
workspace/engine-port/src/multiplex/profile.py
Serving Evaluation
- Serving Runner
workspace/serving-eval/run_serving.py - Serving Trace
workspace/serving-eval/src/trace.py
Reports and Figures
- Figure Renderer
reports/figures/make_figures.py - Figure Data
reports/figures/canon.py - Figure Style
reports/figures/style.py - Research Dashboard
reports/figures/make_dashboard.py
Other components
- GPU
Connections 23
- Experiment Runners → Kernel Builders: builds kernels
workspace/characterization/experiments/e1_prefill_decomp/_e1_worker.py - Experiment Runners → Bandwidth Probe: measures bandwidth
workspace/characterization/experiments/e1_prefill_decomp/_e1_worker.py - Experiment Runners → Profiling Metrics: uses metrics
workspace/characterization/experiments/e1_prefill_decomp/_e1_worker.py - Decode Sweep → Kernel Builders: builds kernels
- Decode Sweep → Bandwidth Probe: measures bandwidth
- Decode Sweep → SM Controller: restricts SMs
workspace/characterization/decode_sm_scaling/_decode_worker.py - Kernel Builders → Shared Loaders: loads configs
workspace/characterization/experiments/common/kernels.py - Kernel Builders → Wave Model: uses wave model
workspace/characterization/experiments/common/kernels.py - Kernel Builders → Bandwidth Probe: uses byte counts
workspace/characterization/experiments/common/kernels.py - Bandwidth Probe → Sweep Specification: reads ceiling
workspace/characterization/experiments/common/bw_probe.py - Bandwidth Probe → Profiling Metrics: uses estimator
workspace/characterization/experiments/common/bw_probe.py - Layer Runner → SM Controller: uses controller
workspace/characterization/src/models/layer_runner.py - Layer Runner → Profiling Metrics: measures metrics
workspace/characterization/src/models/layer_runner.py - Layer Runner → Engine Models: loads model code
workspace/characterization/src/models/layer_runner.py - SM Controller → GPU: partitions SMs
workspace/characterization/src/smctrl/green_ctx_controller.py - Multiplex Controller → Runtime Profile: uses estimates
workspace/engine-port/src/multiplex/controller.py - Serving Runner → Serving Trace: records traces
- Decode Sweep → Crossover Analysis: informs analysis
workspace/characterization/decode_sm_scaling/_decode_worker.py - Figure Renderer → Figure Data: reads data
reports/figures/make_figures.py - Figure Renderer → Figure Style: uses styles
reports/figures/make_figures.py - Research Dashboard → Figure Data: reads data
reports/figures/make_dashboard.py - Research Dashboard → Figure Style: uses styles
reports/figures/make_dashboard.py - Research Dashboard → Figure Renderer: reuses figures
reports/figures/make_dashboard.py