Initialize collective profiler with model config

This commit is contained in:
2026-07-16 21:59:58 +08:00
parent 3121e35b0e
commit 32ab584789
3 changed files with 23 additions and 5 deletions

View File

@@ -1,12 +1,12 @@
version = 1
[[jobs]]
name = "qwen30-vllm020-flashinfer-allreduce-smoke-tp2-20260716-v2-config-context"
name = "qwen30-vllm020-flashinfer-allreduce-smoke-tp2-20260716-v3-model-context"
gpus = 2
gpu_model = "H20"
hosts = ["dash0"]
command = "cd /home/admin/cpfs/wjh/aituner/aituner-qwen30-vllm020-profile-v1/runs/frontier-qwen30-vllm020-profile-v1 && timeout --signal=TERM --kill-after=30s 840 bash run_allreduce_profile.sh"
artifacts = ["artifacts/allreduce-smoke-tp2-v2"]
artifacts = ["artifacts/allreduce-smoke-tp2-v3"]
[jobs.env]
HOME = "/tmp/wjh"
@@ -14,6 +14,6 @@ XDG_CACHE_HOME = "/tmp/wjh/.cache"
VLLM_CACHE_ROOT = "/tmp/wjh/.cache/vllm"
TP = "2"
NUM_TOKENS = "8"
OUTPUT_ROOT = "/home/admin/cpfs/wjh/aituner/aituner-qwen30-vllm020-profile-fleet/artifacts/allreduce-smoke-tp2-v2"
OUTPUT_ROOT = "/home/admin/cpfs/wjh/aituner/aituner-qwen30-vllm020-profile-fleet/artifacts/allreduce-smoke-tp2-v3"
VENV_ROOT = "/tmp/wjh/venvs/vllm-0.20.0-cu129-profiler-v1"
VLLM_SOURCE = "/home/admin/cpfs/wjh/agentic-kv/third_party/vllm_v20_build"

View File

@@ -23,6 +23,7 @@ VLLM_COMMIT = "88d34c6409e9fb3c7b8ca0c04756f061d2099eb1"
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser()
parser.add_argument("--vllm-source", type=Path, required=True)
parser.add_argument("--model", type=Path, required=True)
parser.add_argument("--output", type=Path, required=True)
parser.add_argument("--num-tokens", type=int, nargs="+", default=[8])
parser.add_argument("--hidden-dim", type=int, default=2048)
@@ -69,7 +70,12 @@ def main() -> None:
tensor_model_parallel_all_reduce,
)
from vllm.distributed.parallel_state import get_tp_group
from vllm.config import ParallelConfig, VllmConfig, set_current_vllm_config
from vllm.config import (
ModelConfig,
ParallelConfig,
VllmConfig,
set_current_vllm_config,
)
rank = int(os.environ["RANK"])
local_rank = int(os.environ["LOCAL_RANK"])
@@ -80,7 +86,15 @@ def main() -> None:
torch.accelerator.set_device_index(device)
torch.set_default_device(device)
init_distributed_environment()
model_config = ModelConfig(
model=str(args.model),
dtype="bfloat16",
max_model_len=8192,
skip_tokenizer_init=True,
generation_config="vllm",
)
vllm_config = VllmConfig(
model_config=model_config,
parallel_config=ParallelConfig(tensor_parallel_size=world_size)
)
with set_current_vllm_config(vllm_config):
@@ -162,6 +176,7 @@ def main() -> None:
"torch_version": torch.__version__,
"torch_cuda": torch.version.cuda,
"gpu": torch.cuda.get_device_name(device),
"model": str(args.model),
"backend_env": {
"VLLM_ALLREDUCE_USE_FLASHINFER": "1",
"VLLM_FLASHINFER_ALLREDUCE_BACKEND": "trtllm",

View File

@@ -11,6 +11,7 @@ esac
OUTPUT_ROOT="${OUTPUT_ROOT:?OUTPUT_ROOT must be set}"
VENV_ROOT="${VENV_ROOT:-/tmp/wjh/venvs/vllm-0.20.0-cu129-profiler-v1}"
VLLM_SOURCE="${VLLM_SOURCE:-/home/admin/cpfs/wjh/agentic-kv/third_party/vllm_v20_build}"
MODEL="${MODEL:-/home/admin/cpfs/wjh/models/Qwen/Qwen3-30B-A3B}"
NUM_TOKENS="${NUM_TOKENS:-8}"
mkdir -p "${OUTPUT_ROOT}/logs" "${OUTPUT_ROOT}/provenance" "${OUTPUT_ROOT}/raw"
exec > >(tee -a "${OUTPUT_ROOT}/logs/profile.log") 2>&1
@@ -23,12 +24,13 @@ fi
export VLLM_ALLREDUCE_USE_FLASHINFER=1
export VLLM_FLASHINFER_ALLREDUCE_BACKEND=trtllm
echo "PROFILE_LAUNCH_ECHO host=$(hostname) gpus=${CUDA_VISIBLE_DEVICES} runtime=vLLM-0.20.0+cu129 operator=tensor_model_parallel_all_reduce backend=FlashInfer-TRTLLM tp=${TP} tokens=${NUM_TOKENS} hidden=2048 dtype=BF16 output=${OUTPUT_ROOT} expected_wall=2-6m hard_wall=720s hard_gpu_cap=${HARD_GPU_CAP}"
echo "PROFILE_LAUNCH_ECHO host=$(hostname) gpus=${CUDA_VISIBLE_DEVICES} model=${MODEL} runtime=vLLM-0.20.0+cu129 operator=tensor_model_parallel_all_reduce backend=FlashInfer-TRTLLM tp=${TP} tokens=${NUM_TOKENS} hidden=2048 dtype=BF16 output=${OUTPUT_ROOT} expected_wall=2-6m hard_wall=720s hard_gpu_cap=${HARD_GPU_CAP}"
date -u +"START_UTC=%Y-%m-%dT%H:%M:%SZ"
nvidia-smi --query-gpu=index,name,driver_version,memory.used,utilization.gpu --format=csv,noheader
git rev-parse HEAD > "${OUTPUT_ROOT}/provenance/aituner.commit"
git -C "${VLLM_SOURCE}" rev-parse HEAD > "${OUTPUT_ROOT}/provenance/vllm-source.commit"
sha256sum "${MODEL}/config.json" > "${OUTPUT_ROOT}/provenance/model-config.sha256"
sha256sum profile_vllm020_allreduce.py run_allreduce_profile.sh \
> "${OUTPUT_ROOT}/provenance/source.sha256"
uv pip freeze --python "${VENV_ROOT}/bin/python" \
@@ -41,6 +43,7 @@ timeout --signal=TERM --kill-after=30s 600 \
"${VENV_ROOT}/bin/torchrun" --standalone --nproc_per_node="${TP}" \
profile_vllm020_allreduce.py \
--vllm-source "${VLLM_SOURCE}" \
--model "${MODEL}" \
--output "${OUTPUT_ROOT}/raw/allreduce-tp${TP}.json" \
--num-tokens "${TOKEN_ARGS[@]}" \
--warmup-iters 3 \