ATOM configuration guide#
ATOM (AiTer Optimized Model) is AMD’s lightweight LLM inference engine built on AITER kernels for ROCm/HIP GPUs. This guide documents every configuration class, CLI flag, and environment variable that controls ATOM’s runtime behaviour.
Quick reference#
Config Class |
Primary Purpose |
|---|---|
|
Master dataclass — model path, memory, TP size, scheduler limits, KV cache, profiler, and references to all sub-configs |
|
Compilation level (0-3), CUDA graph capture sizes, piecewise splitting ops, inductor settings |
|
Integer constants for the four compilation levels |
|
Enum controlling how CUDA graphs are captured ( |
|
Layer-wise quantization orchestrator: global config, per-layer overrides, exclude lists, layer name remapping |
|
Per-layer quantization spec (frozen dataclass): quant type, dtype, dynamic flag, method |
|
Data-parallel size, rank, master IP/port |
|
Speculative decoding method, draft model, number of speculative tokens |
|
Per-layer KV cache tensor descriptors (k/v caches and scales) |
|
Temperature, max tokens, stop strings, ignore-EOS flag |
|
CLI argument parser that builds a |
Master configuration (Config)#
Defined in atom/config.py. The root dataclass that the engine consumes.
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
(required) |
HuggingFace model name or local path |
|
|
|
Trust remote code when loading the model from HuggingFace |
|
|
|
Maximum number of tokens batched together per scheduler step |
|
|
|
Multiplicative delay (factor x previous prompt latency) before scheduling the next prompt |
|
|
|
Maximum number of sequences batched together |
|
|
|
Maximum context length; defaults to |
|
|
|
Fraction of GPU memory available for KV cache and weights (0.0 — 1.0) |
|
|
|
Number of tensor-parallel GPUs (1 — 8) |
|
|
|
Disable compilation and CUDA graphs; run in eager mode |
|
|
|
Data-parallel configuration (see Section 4) |
|
|
|
Block size for paged KV cache; must be a multiple of 16 or exactly 1. The DeepSeek-V4 FP4 sparse indexer requires exactly 64; MiniMax-M3’s MXFP4 / NVFP4 KV and index caches require exactly 128 |
|
|
|
Number of KV cache blocks ( |
|
|
|
KV cache data type ( |
|
|
|
Indexer-cache dtype, resolved after model detection. Native single-node DeepSeek-V4 defaults to |
|
|
|
Enable prefix caching to reuse KV blocks across requests sharing the same prefix |
|
|
|
Emit the periodic engine-status line (running/waiting reqs, KV usage, prefix-cache hit rate, prompt/generation throughput). Applies to offline |
|
|
|
Draw a fresh exponential noise row per stochastic row of an unfiltered temperature batch instead of broadcasting one row across the batch, so ordinary |
|
|
|
Seconds between engine-status lines. Must be > 0 |
|
|
|
Forwards between engine-status lines, replacing the clock above when > 0. For offline / MLPerf runs comparing one DP rank’s lines against another’s: the clock lands on a different step number on each rank, a forward count lands on the same one (an idle DP rank counts its dummy). The line reports a cumulative forward count, which is the quantity two ranks share; an all-dummy window still emits its line, since a missing line is what a comparison cannot recover from. Because the window closes on a count rather than a deadline it can span any amount of wall clock, so stretches where no forward ran — idle, stalled on a deferred save or PrefillDone, weights parked by an RL rollout — are subtracted from the |
|
|
|
Requests in the sliding window behind the engine-status line’s prefix-cache hit rate. Must be > 0. Only that line is windowed; |
|
|
|
Size pipeline-parallel prefill chunks from a calibrated equal-latency model. Needs |
|
|
|
Blend from the initial chunk ( |
|
|
|
Floor for a solved chunk. Must be positive when the feature is on |
|
|
|
For models with per-request state (DeepSeek-V4 compressor ring, GDN recurrent state, Kimi-K3 KDA): tokens between rungs of the checkpoint ladder. The sign carries three policies — |
|
|
|
Whether a prefix hit refused for want of a checkpoint may place a rung of its own. Off leaves the prompt-end anchor as the only placement. Overridden by |
|
|
|
DeepSeek-V4.1 only: prefill runs the decoder (layers 20…39) only on the rows the next forward reads, its windows truncated there (the V4.1 report’s SWA Bounded Replay). Faster prefill, not numerically equivalent to a full prefill. See DeepSeek-V4.1 runtime |
|
|
|
DeepSeek-V4.1 only: a prefix hit resumes without a state checkpoint, rebuilding the sliding-window state from the hash block below the hit; no state checkpoint is kept. See DeepSeek-V4.1 runtime |
|
|
|
Set by the model, not a flag: the fewest rows the forward finishing a prompt runs; one resuming closer to the end starts earlier, on the hash-block grid ( |
|
|
|
Set by the model, not a flag: the tokens before a forward that starts below where its prefill resumed which the backend reads ( |
|
|
|
Set by the model, not a flag: how far below a prefix hit with no state checkpoint behind it a prefill starts to rebuild that state exactly ( |
|
|
|
Engine internal communication port |
|
|
|
Directory for saving PyTorch profiler traces; creates the directory if it does not exist. |
|
|
|
Compilation and CUDA graph settings (see Section 2) |
|
|
(auto-detected) |
Quantization settings; auto-detected from HuggingFace config during |
|
|
|
Enable asyncio-based engine loop |
|
|
|
Dummy-weight mode (no checkpoint read): |
|
|
|
Enable Expert Parallelism for MoE models |
|
|
|
Master address for distributed communication |
|
|
|
Explicit list of batch sizes for CUDA graph capture; derived from |
|
|
|
Enable data-parallel attention |
|
|
|
DP request-routing strategy: |
|
|
(computed) |
Inferred from |
|
|
|
Speculative decoding configuration (see Section 5) |
|
|
|
Beginning-of-sequence token ID ( |
|
|
|
End-of-sequence token ID ( |
|
|
|
Additional stop token IDs; populated from |
Auto-derived fields (set in __post_init__ or by ModelRunner.get_num_blocks(), not user-supplied):
Field |
Type |
Description |
|---|---|---|
|
|
Loaded automatically via |
|
|
Loaded automatically via |
|
|
Entries sized for each cache class the attention builders declared via |
|
|
Per-request multiplicity of each class, so a consumer can turn an entry count into a request count ( |
Compilation configuration (CompilationConfig)#
Defined in atom/config.py. Controls torch.compile and CUDA graph behaviour.
Compilation levels (CompilationLevel)#
Constant |
Value |
Description |
|---|---|---|
|
|
No compilation — pure eager execution |
|
|
Use torch.compile / TorchDynamo as-is |
|
|
TorchDynamo with a single compilation pass |
|
|
Piecewise compilation: the graph is split at |
CompilationConfig fields#
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Compilation level (see table above); must be 0 — 3 |
|
|
|
Whether to use CUDA graphs |
|
|
|
Explicit list of batch sizes for CUDA graph capture; overrides |
|
|
|
CUDA graph sizing strategy: 1 value generates |
|
|
|
Path to dump debug / compilation information |
|
|
|
Directory for compilation caches |
|
|
|
Enable TorchInductor backend |
|
|
|
CUDA graph capture mode (see CUDA graph mode); set to |
|
|
|
Ops that split the graph into sub-graphs for piecewise compilation; auto-populated at level 3 with |
|
|
|
Copy input tensors into internally managed buffers before CUDA graph replay; effective at level 3 whenever |
|
|
|
Sizes to compile for inductor; accepts integers and the string |
|
|
|
Additional configuration passed to the inductor backend |
CUDA graph mode (CUDAGraphMode)#
Mode |
Value |
Description |
|---|---|---|
|
|
No CUDA graph capture |
|
|
Token graphs and request graphs mixed: a token graph per token bucket, breaking only where a launch depends on host data (default at level 3) |
|
|
Full CUDA graph capture for all batches; best for small models / short prompts |
|
|
Full CUDA graphs for decode batches only; mixed prefill-decode runs without graphs (useful in P/D setups) |
|
|
Recorded as |
Helper methods on CUDAGraphMode:
decode_mode()— returns the mode used for pure decode batches.mixed_mode()— returns the mode used for mixed prefill-decode batches.uses_tr_hybrid()— whether the mode records token graphs.has_full_cudagraphs()— whether the mode includes full CUDA graph capture.separate_routine()— whether decode and mixed batches use different routines.
Quantization configuration (QuantizationConfig & LayerQuantConfig)#
Defined in atom/config.py and atom/quant_spec.py. The quantization system uses two classes:
QuantizationConfig— the top-level orchestrator that holds a global config, per-layer overrides, and exclusion lists.LayerQuantConfig— a frozen dataclass (defined inatom/quant_spec.py) that stores the concrete quantization parameters for a single layer or as the global default. Typed, immutable, with attribute access (e.g.,spec.quant_type).
LayerQuantConfig fields#
LayerQuantConfig is a frozen dataclass. Fields are accessed as typed attributes (e.g., spec.quant_type).
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Quantization granularity (see |
|
|
|
Data type for quantized weights |
|
|
|
Use dynamic quantization (scales computed at runtime) |
|
|
|
Quantization method (e.g., |
QuantizationConfig attributes#
Attribute |
Type |
Description |
|---|---|---|
|
|
The model’s default dtype (from |
|
|
Raw |
|
|
Default quantization spec applied to all layers |
|
|
Per-layer overrides keyed by layer name pattern (supports fnmatch globs like |
|
|
Layer names excluded from quantization (supports exact match and |
|
|
Top-level quantization method name (e.g., |
Key methods:
Method |
Description |
|---|---|
|
Returns the quantization method name |
|
Returns the |
|
Remaps layer names for packed/fused modules (e.g., |
|
Returns a SHA-256 hash of the quantization config for cache invalidation |
QuantType values (from AITER)#
Value |
Description |
|---|---|
|
No quantization |
|
Per-token / per-channel quantization |
|
Block quantization with group size 128 |
|
Block quantization with group size 32 |
|
Large 2D block quantization (remapped to |
|
Per-tensor quantization |
Supported quantization dtypes#
Dtype |
AITER Key |
Notes |
|---|---|---|
FP8 (E4M3) |
|
8-bit floating point |
MXFP4 |
|
Microscaling FP4; forces |
INT8 |
|
8-bit integer |
INT4 |
|
4-bit integer (packed) |
Auto-detection from HuggingFace#
During Config.__post_init__, ATOM constructs QuantizationConfig(hf_config) which
reads hf_config.quantization_config and automatically determines quantization
parameters:
For quark models (quant_method == "quark"):
Parses
global_quant_configdict viaQuarkParserto produce the globalLayerQuantConfig.Parses each entry in
layer_quant_configdict to produce per-layer overrides.Reads the
"exclude"list for excluded layers.Within each config dict,
weight.qschemedeterminesquant_type("per_channel"→per_Token,"per_tensor"→per_Tensor,"per_group"→per_1x32), andweight.dtypedeterminesquant_dtype.input_tensors.is_dynamiccontrols dynamic quantization (defaults toTrueif absent).
For other models (compressed-tensors, etc.):
If
quant_method == "compressed-tensors"or channel quantization is detected, setsper_Token.If
weight_block_sizeorgroup_sizeis found: group size 128 maps toper_1x128, group size 32 maps toper_1x32.Otherwise falls back to
per_Tensor.The dtype is parsed from fields like
dtype,weight_dtype, orquant_methodlooking forfp8,fp4,mxfp4,int8,int4, ornum_bits.If
activation_schemeis"static",is_dynamicis set toFalse.Excluded layers are read from the
"ignore"key.
Layer-level quantization dispatch#
Linear layers, MoE layers, and fused ops call quant_config.get_layer_quant_config(prefix) to obtain the appropriate LayerQuantConfig for their position in the model. This enables mixed-precision quantization where different layers can have different quant types and dtypes (e.g., FP8 for attention, FP4 for MLP).
Online quantization at load time#
ATOM can re-quantize model weights while loading them by passing
--online_quant_config to the engine. This is useful when the source checkpoint
is unquantized or uses a different supported quantization layout than the runtime
layout you want to benchmark.
For ready-to-run recipes (DeepSeek-R1, Qwen3 MoE, …), pattern-design guidance, verification, and troubleshooting, see
online_quantization_guide.md. This section documents only the field-level reference.
The flag accepts a JSON object:
--online_quant_config '{
"global_quant_config": "ptpc_fp8",
"layer_quant_config": {"*expert*": "mxfp4"},
"exclude_layer": ["lm_head", "*.gate.*"]
}'
Fields:
Field |
Type |
Description |
|---|---|---|
|
|
Default target quantization format for all layers. |
|
|
Per-layer target overrides. Keys are fnmatch-style layer patterns such as |
|
|
Layers to leave unquantized. Supports exact/prefix matches, glob patterns, and |
Supported target format strings:
Format |
Target config |
|---|---|
|
|
|
|
Notes:
An empty JSON object (
--online_quant_config '{}') is treated the same as not passing the flag and does not enable online quantization.Online quantization currently applies when the source model is unquantized, uses supported FP8 block quantization (
QuantType.per_1x128) or has MXFP4 MoE experts (QuantType.per_1x32). The loader dequantizes FP8 block weights and MXFP4 experts before applying the requested target format.Tensor-parallel weights are gathered before quantization only when local quantization would produce different scales than quantizing the full unpartitioned weight.
Rank 0 writes an
online_quant_info_*.jsonsummary with elapsed time and per-layer target formats. The file is written underATOM_ONLINE_QUANT_INFO_DIRwhen set, otherwise underATOM_TORCH_PROFILER_DIR, otherwise in the current working directory.
Parallel configuration (ParallelConfig)#
Defined in atom/config.py. Controls data parallelism. Environment variables
(Section 8) override defaults when set.
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Number of data-parallel groups; overridden by |
|
|
|
DP ranks on this node. Defaults to the global size, i.e. single-node. Set it lower to give a node one slice of a multi-node run; also reaches MoRI as |
|
|
|
First global DP rank owned by this node; overridden by |
|
|
|
Local rank within the data-parallel group (SPMD mode); overridden by |
|
|
|
Port used by the data-parallel master for process group initialization |
|
|
|
Model-runner TCPStore port; automatically bound for single-node runs, explicitly shared across nodes |
|
|
|
IP address of the data-parallel master |
Computed property:
world_size— set during init, equals TP x PP.world_size_across_dp—world_size * data_parallel_size.
Speculative decoding configuration (SpeculativeConfig)#
Defined in atom/config.py. Currently only the Multi-Token Prediction (MTP)
method with num_speculative_tokens=1 is supported.
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Speculative decoding method; currently only |
|
|
|
Draft model name or path (typically the same as the target model for MTP) |
|
|
|
Number of speculative tokens per iteration; must be |
|
|
|
HuggingFace config for the draft model; auto-loaded from |
|
|
|
KV dtype of the draft’s pages as requested ( |
|
|
|
KV dtype of the draft’s pages (not an |
Table-driven MTP config#
MTP configuration uses two class-level lookup tables to support multiple model families without per-model branching.
_MTP_TYPE_MAP — maps a base model_type to its MTP model_type:
Base |
MTP |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_MTP_CONFIG — maps MTP model_type to a (n_predict_attr, architecture) tuple:
MTP |
|
Architecture |
|---|---|---|
|
|
|
|
|
|
|
|
|
Post-init behaviour (hf_config_override)#
The static method hf_config_override applies a two-step transformation to the
draft model’s HuggingFace config:
Resolve model type — looks up
hf_config.model_typein_MTP_TYPE_MAP. If found, rewritesmodel_typeto the MTP variant (e.g.deepseek_v3->deepseek_mtp).Apply MTP overrides — looks up the (possibly rewritten)
model_typein_MTP_CONFIG. If found:Reads
n_predictfrom the model-specific attribute (e.g.num_nextn_predict_layersormtp_num_hidden_layers), defaulting to 1. Warns and forces it to 1 if the original value differs.Sets
n_predict=1,num_nextn_predict_layers=1(universal across all MTP families), andarchitecturesto the corresponding MTP model class.Qwen3.5 MTP only: additionally injects
n_shared_experts=1andn_routed_experts(read fromhf_config.num_experts, default 0) so the MTP module can construct its MoE layer.
Other post-init steps:
Loads
draft_model_hf_configfrommodelif not provided.Extracts
text_configfrom multimodal model configs when present.Config.__post_init__raisesValueErrorifnum_speculative_tokens != 1.
Sampling parameters (SamplingParams)#
Defined in atom/sampling_params.py. Passed per-request to control generation.
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Sampling temperature; lower values make output more deterministic |
|
|
|
Maximum number of tokens to generate |
|
|
|
Continue generating past the EOS token |
|
|
|
List of strings that trigger generation to stop |
CLI arguments (EngineArgs)#
Defined in atom/model_engine/arg_utils.py. The EngineArgs dataclass exposes
all flags via add_cli_args() and converts them into a Config via
create_engine().
Flag |
Short |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
Model name or path |
|
|
flag |
|
Trust remote code when loading model |
|
|
|
|
|
Tensor parallel size |
|
|
|
|
Data parallel size |
|
|
|
|
Ulysses sequence parallel size; requires |
|
flag |
|
Enforce eager mode execution |
|
|
flag |
|
Enable prefix caching |
|
|
flag |
|
Emit the periodic engine-status line |
|
|
|
|
Seconds between engine-status lines |
|
|
|
|
Forwards between engine-status lines instead of seconds; base and DP engines only |
|
|
flag |
|
Draw fresh per-row exponential noise for unfiltered temperature sampling instead of broadcasting one noise row over the batch. Off by default, which keeps the shared-row behaviour. Enabling it samples ordinary |
|
|
|
|
Engine internal port |
|
|
|
|
KV cache dtype; choices: |
|
|
|
|
Indexer-cache dtype; choices: |
|
|
|
|
KV cache block size (maps to |
|
|
|
|
Maximum model context length; defaults to |
|
|
|
|
CUDA graph capture sizes as a Python list string |
|
|
|
|
Compilation level (0 — 3) |
|
|
|
|
Dummy weights: bare/ |
|
|
flag |
|
Enable Expert Parallelism (EP MoE) |
|
|
|
|
MoE implementation; choices: |
|
|
|
|
Directory for torch profiler traces |
| --enable-dp-attention | | flag | False | Enable DP attention |
| --method | | str | None | Speculative method; choices: mtp, eagle3, dspark |
| --num-speculative-tokens | | int | 1 | Number of speculative tokens per iteration |
| --spec-decode-kv-cache-dtype | | str | None | The draft’s KV dtype, SpeculativeConfig.kv_cache_dtype (native ATOM has no --spec-decode-config JSON; this flag is its setting); choices: bf16, fp8. Needs --method and --num-speculative-tokens > 0. See the SpeculativeConfig table for what each value means per draft. Refused for a DeepSeek-V4.1 DSpark draft, whose setting is --dspark-config '{"draft_kv_dtype":"fp8"}' (a different setting) |
| --max-num-batched-tokens | | int | 16384 | Maximum number of tokens to batch in the async engine |
| --state-checkpoint-interval-tokens | | int | 8192 | Tokens between rungs of the per-request state checkpoint ladder; must be a multiple of the prefix-cache hash block size. 0 turns checkpointing off entirely; -1 turns off only the ladder, leaving the prompt-end anchor and the demand rung as the placements. Prompts shorter than one interval publish no rung. A rung also quantizes prefill chunk boundaries, since a checkpoint is only valid where a forward ends exactly on one — which is most of what -1 buys back |
| --state-checkpoint-demand / --no-state-checkpoint-demand | | bool | on | Let a prefix hit that was refused for want of a checkpoint place a rung of its own. Off leaves the prompt-end anchor as the only placement. ATOM_STATE_CHECKPOINT_DEMAND=0 overrides this without touching a launch script |
| --decoder-swa-bounded-replay / --no-decoder-swa-bounded-replay | --enable-decoder-swa-bounded-replay | bool | on | DeepSeek-V4.1 only: the forward finishing a prompt runs the decoder (layers 20…39) on its last 128 rows only, their windows truncated at the first of them, and layer 39’s query on the last row; one that does not finish runs none of it past layer 20’s compression (the V4.1 report’s SWA Bounded Replay). Not numerically equivalent to a full prefill. No effect on other models |
| --encoder-swa-bounded-replay / --no-encoder-swa-bounded-replay | --enable-encoder-swa-bounded-replay | bool | on | DeepSeek-V4.1 only: a prefix hit resumes without a state checkpoint, recomputing the hash block below the hit to rebuild the sliding-window state (no cached row is rewritten); no state checkpoint is kept, so none cuts a prefill chunk. Not numerically equivalent to resuming a checkpoint. No effect on other models |
| --max-num-seqs | | int | 512 | Maximum number of sequences to batch together |
| --gpu-memory-utilization | | float | 0.9 | Fraction of GPU memory to use (0.0 — 1.0) |
| --scheduler-delay-factor | | float | 0.0 | Delay factor multiplied by previous prompt latency before scheduling next prompt |
| --prefill-admit-policy | | str | interval | When the prefill delayer admits new prefills. interval (default) keeps ATOM_PREFILL_DECODE_INTERVAL and the coalescer. adaptive replaces both, after the must-fire bounds (no decode, KV, MAX_QUEUE_MS, TTFT_MAX_TICKS): it fits the decode step as T0 + c*b and the prefill step as A + k*n from measured step times, and fires once the held requests’ accumulated cost (sum over held ticks of admittable requests × T0) reaches the fixed prefill cost × decode batch (A × B), i.e. the EOQ / rent-or-buy point. T0 is taken as 0.75 × the mean decode step and A is clamped to 0.3–1.5 × the mean prefill step; a FIRE comes on the 4th decision after the previous one at the earliest (3 held ticks), and at the latest once about 600 ms of decode steps have passed (cold start: 24 decisions; at most 200). These are fixed constants in prefill_delayer.py. Fits and counts ride the delayer’s existing all_reduce, so DP ranks decide in lockstep. Like a positive interval, it enables local coalescing on DP=1, PP=1, i.e. on plain TP runs too; the measurements so far are DEP4 only, so TP-only gains are unverified. Counterpart of vLLM’s --prefill-schedule-interval (off by default there too). |
| --online_quant_config | | JSON string | None | Load-time online quantization override; see Section 3.7 |
Programmatic distributed option#
Config.disable_custom_all_reduce defaults to False. Set it to True when
constructing an engine to disable AITER’s HIP-IPC custom all-reduce and use the
standard RCCL path. ATOM applies this policy before distributed/model-parallel
initialization, including the RLHF DP and pipeline-parallel paths.
Example:
python -m atom.entrypoint \
--model deepseek-ai/DeepSeek-R1 \
--tensor-parallel-size 8 \
--level 3 \
--cudagraph-capture-sizes "[1,2,4,8,16,32,64,128,256]" \
--kv_cache_dtype fp8 \
--gpu-memory-utilization 0.92 \
--max-num-seqs 256
Environment variables#
Variables registered in atom/utils/envs.py#
All variables use lazy evaluation. Boolean variables treat "1" as True and
anything else (including unset) as False, unless noted otherwise.
Variable |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Data-parallel rank of this process |
|
|
|
Local data-parallel rank (for SPMD mode) |
|
|
|
Total number of data-parallel groups |
|
|
|
IP address of the data-parallel master |
|
|
|
Port of the data-parallel master |
|
|
|
Default for |
~~ |
Removed. Use CLI flag |
||
|
|
|
Enable QK-norm + RoPE + cache + quant fusion for Qwen3 dense and MoE models |
|
|
|
Use Triton-based GEMM kernels instead of default backends |
|
|
|
Use Triton-based MXFP4 batched matrix multiply |
|
|
|
Enable fused input RMSNorm + quantization for DeepSeek models |
|
|
|
Enable fused QK-norm + quantization for DeepSeek models |
|
|
|
Enable fused all-reduce + RMSNorm kernel |
|
|
|
Use aiter’s Gluon fused all-reduce + RMSNorm for decode at TP4 (sets |
|
|
|
Enable AITER Triton fused RMSNorm + quantization for LLaMA models |
|
|
|
Enable AITER Triton fused SiLU + multiply + quantization for LLaMA models |
Additional environment variables (used outside envs.py)#
Variable |
Type |
Default |
Where Used |
Description |
|---|---|---|---|---|
|
|
|
|
Directory for PyTorch profiler output; sets the default for |
|
|
|
|
Set to |
|
|
|
|
HuggingFace authentication token for gated model downloads |
Decision tree — choosing a compilation level#
Start
|
v
Is this a debugging / development run?
|-- Yes --> Level 0 (NO_COMPILATION) or --enforce-eager
|
v
Do you need torch.compile but no graph splitting?
|-- Yes, one-shot compile --> Level 2 (DYNAMO_ONCE)
|-- Yes, keep Dynamo default --> Level 1 (DYNAMO_AS_IS)
|
v
Production inference on ROCm/HIP GPU?
|-- Yes --> Level 3 (PIECEWISE) [default in EngineArgs]
- Auto-sets CUDAGraphMode.TR_HYBRID
- Auto-populates splitting_ops for attention ops
- Pair with --cudagraph-capture-sizes for your batch profile
|
v
Need maximum decode throughput?
|-- Yes --> set cudagraph_mode to FULL
(a whole-forward request graph per decode bucket)
Rules of thumb:
Level 3 is the default for
EngineArgsand is recommended for most production workloads.Level 0 /
--enforce-eageris useful for debugging, profiling, or when CUDA graphs are incompatible with your model.Match
--cudagraph-capture-sizesto your expected batch sizes for optimal memory usage and launch latency.When using
--enable-dp-attentionor Expert Parallelism (--enable-expert-parallel), level 3 is still recommended.
Source files#
File |
Description |
|---|---|
|
|
|
All |
|
|
|
|
|
Uses |