Skip to content

vllm.model_executor.warmup.rocm_segmented_attn_autotune_warmup

Startup-only, persistent launch tuning for segmented ROCm attention.

Functions:

_candidate_configs(default, batch, query_len, heads, dim, seq_len=None, *, native_fp8=False, legacy_default=None)

Search conversion modes jointly with each eligible launch geometry.

_initial_search_configs(configs)

Screen native4 geometries while retaining the static incumbent.

_launch_candidate_configs(default, batch, query_len, heads, dim, seq_len=None)

Search launch tiles and split counts within a bounded workspace.

_load_records(path, identity, heads, kv_heads, dim, fp8)

Load a canonical table and any crash-recovery TP shards.

_measure_configs(configs, run, device, eviction, rounds, graph_calls=0)

Interleave candidates so clock and thermal drift affect them evenly.

_runtime_config(record, batch, query_len, seq_len, heads, kv_heads, dim, fp8, *, sliding_window=-1)

Preserve tuned parallelism below a warmed batch/query ceiling.

_select_tuned_winner(default, finalists, samples, min_promotion_speedup=_MIN_PROMOTION_SPEEDUP, *, warm_samples=None)

Return a finalist only when it reliably beats the static incumbent.

_shard_workloads(workloads, world_size, max_tokens, heads, kv_heads, dim, fp8)

Balance compile-affine (batch, query) groups across TP ranks.

_temporary_tuning_kernels(device)

Release tuning-only HIP modules without invalidating existing graphs.

_tp_context()

Return the initialized TP coordinator, or local-only tuning state.

_upcast_expansion_configs(configs, comparisons)

Expand conversion modes on promising or unmeasurable geometries.

_workload_weight(workload, max_tokens, heads, kv_heads, dim, fp8)

Estimate compile plus execution cost for TP workload balancing.

get_segmented_config(device, dtype, kv_dtype, heads, kv_heads, dim, page, scale, batch, query_len, seq_len, sliding_window=-1, causal=True, has_sinks=False)

Return a warmed ceiling bucket, or None for the static fallback.

rocm_segmented_attn_autotune_warmup(worker)

Autotune RDNA segmented attention after KV allocation and before capture.

warmup_segmented_attention(device, dtype, heads, kv_heads, dim, page, scale, max_tokens, max_len, max_seqs, *, memory_budget_bytes=None, cache_layouts=(), cache_budget_bytes=None, kv_dtype=torch.bfloat16, sliding_window=-1, causal=True, max_query_len=MAX_QUERY_LEN, has_sinks=False, physical_max_len=None)

Tune reachable segmented buckets before graph capture.