Skip to content

[Misc] Remove deprecated profiler environment variables#33536

Merged
DarkLight1337 merged 1 commit intovllm-project:mainfrom
carlory:cleanup/remove-deprecated-profiler-env-vars
Feb 3, 2026
Merged

[Misc] Remove deprecated profiler environment variables#33536
DarkLight1337 merged 1 commit intovllm-project:mainfrom
carlory:cleanup/remove-deprecated-profiler-env-vars

Conversation

@carlory
Copy link
Copy Markdown
Contributor

@carlory carlory commented Feb 2, 2026

Purpose

Remove deprecated environment variables for profiler configuration that were scheduled for removal in v0.15.0. The deprecation warning stated:

"Using %s environment variable is deprecated and will be removed in v0.15.0 or v1.0.0, whichever is soonest."

Since v0.15.0 has been released, it's time to clean up these deprecated environment variables.

Changes

vllm/config/profiler.py

  • Removed _get_from_env_if_set() method
  • Removed _set_from_env_if_set() method
  • Simplified _validate_profiler_config() validator by removing all environment variable reading logic
  • Removed import vllm.envs as envs

vllm/envs.py

Removed 11 deprecated environment variables:

  • VLLM_TORCH_CUDA_PROFILE
  • VLLM_TORCH_PROFILER_DIR
  • VLLM_TORCH_PROFILER_RECORD_SHAPES
  • VLLM_TORCH_PROFILER_WITH_PROFILE_MEMORY
  • VLLM_TORCH_PROFILER_DISABLE_ASYNC_LLM
  • VLLM_TORCH_PROFILER_WITH_STACK
  • VLLM_TORCH_PROFILER_WITH_FLOPS
  • VLLM_TORCH_PROFILER_USE_GZIP
  • VLLM_TORCH_PROFILER_DUMP_CUDA_TIME_TOTAL
  • VLLM_PROFILER_DELAY_ITERS
  • VLLM_PROFILER_MAX_ITERS

Migration

Users should migrate to using:

  • Command-line arguments: --profiler-config.torch_profiler_dir=/path/to/dir
  • Direct config: ProfilerConfig(torch_profiler_dir="/path/to/dir")

Test Plan

  • pre-commit checks pass
  • Python syntax validation passes

Test Result

All pre-commit hooks passed successfully.

Remove deprecated environment variables for profiler configuration that
were scheduled for removal in v0.15.0. Users should now use the
`--profiler-config.*` command line arguments or `ProfilerConfig(...)`
directly.

Removed environment variables:
- VLLM_TORCH_CUDA_PROFILE
- VLLM_TORCH_PROFILER_DIR
- VLLM_TORCH_PROFILER_RECORD_SHAPES
- VLLM_TORCH_PROFILER_WITH_PROFILE_MEMORY
- VLLM_TORCH_PROFILER_DISABLE_ASYNC_LLM
- VLLM_TORCH_PROFILER_WITH_STACK
- VLLM_TORCH_PROFILER_WITH_FLOPS
- VLLM_TORCH_PROFILER_USE_GZIP
- VLLM_TORCH_PROFILER_DUMP_CUDA_TIME_TOTAL
- VLLM_PROFILER_DELAY_ITERS
- VLLM_PROFILER_MAX_ITERS

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: carlory <baofa.fan@daocloud.io>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly removes deprecated environment variables for profiler configuration. The changes in vllm/config/profiler.py and vllm/envs.py are straightforward and effectively clean up obsolete code, which improves maintainability. The implementation aligns with the stated purpose in the description. The changes look good.

Copy link
Copy Markdown
Member

@yewentao256 yewentao256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the work!

@yewentao256 yewentao256 added the ready ONLY add when PR is ready to merge/full CI is needed label Feb 2, 2026
@DarkLight1337 DarkLight1337 merged commit ef248ff into vllm-project:main Feb 3, 2026
45 checks passed
Comment thread vllm/config/profiler.py
Comment on lines -105 to -137
def _get_from_env_if_set(self, field_name: str, env_var_name: str) -> None:
"""Get field from env var if set, with deprecation warning."""

if envs.is_set(env_var_name):
value = getattr(envs, env_var_name)
logger.warning_once(
"Using %s environment variable is deprecated and will be removed in "
"v0.15.0 or v1.0.0, whichever is soonest. Please use "
"--profiler-config.%s command line argument or "
"ProfilerConfig(%s=...) config field instead.",
env_var_name,
field_name,
field_name,
)
return value
return None

def _set_from_env_if_set(
self,
field_name: str,
env_var_name: str,
to_bool: bool = True,
to_int: bool = False,
) -> None:
"""Set field from env var if set, with deprecation warning."""
value = self._get_from_env_if_set(field_name, env_var_name)
if value is not None:
if to_bool:
value = value == "1"
if to_int:
value = int(value)
setattr(self, field_name, value)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add general versions of these methods back in utils.py so that we don't have to keep reinventing them when we do future deprecations

PiratePai pushed a commit to PiratePai/epd_shm that referenced this pull request Feb 3, 2026
…#33536)

Signed-off-by: carlory <baofa.fan@daocloud.io>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Pai <416932041@qq.com>
PiratePai pushed a commit to PiratePai/epd_shm that referenced this pull request Feb 3, 2026
…#33536)

Signed-off-by: carlory <baofa.fan@daocloud.io>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Pai <416932041@qq.com>
@carlory carlory deleted the cleanup/remove-deprecated-profiler-env-vars branch February 4, 2026 02:15
gameofdimension pushed a commit to gameofdimension/vllm that referenced this pull request Feb 5, 2026
…#33536)

Signed-off-by: carlory <baofa.fan@daocloud.io>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: felix01.yu <felix01.yu@vipshop.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants