-
Notifications
You must be signed in to change notification settings - Fork 999
[Refactor] Unify torch profiler for omni and diffusion models #1261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c7a3ce4
2149f41
d372027
0a66ff6
7e4ea95
c450de6
b200138
98ad751
a6968ab
dd6813b
8944784
733de3b
58e626a
baf4e6e
644fb72
6a8570a
f6914b4
a2b1aaa
b320cf4
4806fba
69c329c
96d4173
a33c6b9
f1f128b
be83458
676d2ec
3d2c71a
c95d2b2
c0796ef
7668801
f311c5a
e22baa0
17da063
14593d8
6f5bd1a
40ba4bd
3f00058
26c0504
04af2b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -377,9 +377,9 @@ def main(args): | |||||
| for i, prompt in enumerate(prompts): | ||||||
| prompt["modalities"] = output_modalities | ||||||
|
|
||||||
| profiler_enabled = bool(os.getenv("VLLM_TORCH_PROFILER_DIR")) | ||||||
| profiler_enabled = args.enable_profiler is not None | ||||||
|
gcanlin marked this conversation as resolved.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Also
Suggested change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For omni model, will unify to enable_profiler. Because profiler_dir will need to be defined in yaml config. |
||||||
| if profiler_enabled: | ||||||
| omni_llm.start_profile(stages=[0]) | ||||||
| omni_llm.start_profile(stages=args.profiler_stages) | ||||||
| omni_generator = omni_llm.generate(prompts, sampling_params_list, py_generator=args.py_generator) | ||||||
|
|
||||||
| # Determine output directory: prefer --output-dir; fallback to --output-wav | ||||||
|
|
@@ -419,7 +419,7 @@ def main(args): | |||||
| if profiler_enabled and processed_count >= total_requests: | ||||||
| print(f"[Info] Processed {processed_count}/{total_requests}. Stopping profiler inside active loop...") | ||||||
| # Stop the profiler while workers are still alive | ||||||
| omni_llm.stop_profile() | ||||||
| omni_llm.stop_profile(stages=args.profiler_stages) | ||||||
|
|
||||||
| print("[Info] Waiting 30s for workers to write massive trace files to disk...") | ||||||
| time.sleep(30) | ||||||
|
|
@@ -539,6 +539,19 @@ def parse_args(): | |||||
| default=False, | ||||||
| help="Use py_generator mode. The returned type of Omni.generate() is a Python Generator object.", | ||||||
| ) | ||||||
| parser.add_argument( | ||||||
| "--profiler-dir", | ||||||
| action="store_true", | ||||||
| default=False, | ||||||
| help="Enable torch profiler traces. Enables profiling when set.", | ||||||
| ) | ||||||
| parser.add_argument( | ||||||
| "--profiler-stages", | ||||||
| type=int, | ||||||
| nargs="+", | ||||||
| default=None, | ||||||
| help="Stage IDs to profile (e.g. --profiler-stages 0 1 2). If not set, profiles all stages.", | ||||||
| ) | ||||||
| return parser.parse_args() | ||||||
|
|
||||||
|
|
||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.