File tree Expand file tree Collapse file tree 4 files changed +5
-0
lines changed
Expand file tree Collapse file tree 4 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ SGLang supports various environment variables that can be used to configure its
9494| --- | --- | --- |
9595| ` SGLANG_TORCH_PROFILER_DIR ` | Directory for PyTorch profiler output | ` /tmp ` |
9696| ` SGLANG_PROFILE_WITH_STACK ` | Set ` with_stack ` option (bool) for PyTorch profiler (capture stack trace) | ` true ` |
97+ | ` SGLANG_PROFILE_RECORD_SHAPES ` | Set ` record_shapes ` option (bool) for PyTorch profiler (capture shapes) | ` true ` |
9798
9899## Storage & Caching
99100
Original file line number Diff line number Diff line change 108108 ```
109109 export SGLANG_TORCH_PROFILER_DIR=./
110110 export SGLANG_PROFILE_WITH_STACK=1
111+ export SGLANG_PROFILE_RECORD_SHAPES=1
111112 <launch the server>
112113 <launch the client with the additional --profile argument>
113114 ```
Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ class Envs:
117117 SGLANG_TEST_RETRACT = EnvBool (False )
118118 SGLANG_SET_CPU_AFFINITY = EnvBool (False )
119119 SGLANG_PROFILE_WITH_STACK = EnvBool (True )
120+ SGLANG_PROFILE_RECORD_SHAPES = EnvBool (True )
120121 SGLANG_RECORD_STEP_TIME = EnvBool (False )
121122 SGLANG_GC_LOG = EnvBool (False )
122123 SGLANG_FORCE_SHUTDOWN = EnvBool (False )
Original file line number Diff line number Diff line change @@ -310,6 +310,8 @@ async def start_profile(
310310 self .auto_create_handle_loop ()
311311 env_with_stack : bool = get_bool_env_var ("SGLANG_PROFILE_WITH_STACK" , "true" )
312312 with_stack = False if with_stack is False or env_with_stack is False else True
313+ env_record_shapes : bool = get_bool_env_var ("SGLANG_PROFILE_RECORD_SHAPES" , "true" )
314+ record_shapes = False if record_shapes is False or env_record_shapes is False else True
313315 req = ProfileReq (
314316 type = ProfileReqType .START_PROFILE ,
315317 output_dir = output_dir ,
You can’t perform that action at this time.
0 commit comments