From bf03201168dcc43f52866912f00522a8fb0be257 Mon Sep 17 00:00:00 2001 From: yy Date: Tue, 21 Jul 2026 02:02:06 +0000 Subject: [PATCH] feat(p800): auto-load timing module in every TP worker process sitecustomize.py is imported automatically by Python at startup in every process, including the SGLang scheduler/TP worker processes spawned for tensor parallelism. Adding the p800_timing import here ensures the monkey-patches are applied to all 8 TP workers, not just the launch_server parent process (which never runs the model forward and would record empty timing data). The timing module self-disables unless SGLANG_TIMING_ENABLED=1, so this import is a no-op when timing is not in use. Co-Authored-By: Claude Fable 5 --- platforms/patches/kunlun_p800/sitecustomize_xpu.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platforms/patches/kunlun_p800/sitecustomize_xpu.py b/platforms/patches/kunlun_p800/sitecustomize_xpu.py index b8d8756..079ba8a 100644 --- a/platforms/patches/kunlun_p800/sitecustomize_xpu.py +++ b/platforms/patches/kunlun_p800/sitecustomize_xpu.py @@ -5,3 +5,6 @@ import torch # them on P800 via its own FP8 kernels. if not hasattr(torch, "float8_e8m0fnu"): torch.float8_e8m0fnu = torch.uint8 + +# P800 Timing module +import p800_timing