Add per-run profiling config for fine-grained Run() profiling#2152
Draft
xiaofeihan1 wants to merge 1 commit into
Draft
Add per-run profiling config for fine-grained Run() profiling#2152xiaofeihan1 wants to merge 1 commit into
xiaofeihan1 wants to merge 1 commit into
Conversation
Adds model.decoder.run_profiling to genai_config.json so users can
profile selected session.Run() calls (e.g. only prefill, or only the
N-th decode) without modifying Python code. The existing
set_runtime_option('enable_profiling', ...) path already supports per-
run profiling but requires API calls per experiment; this surfaces the
same capability via config.
Schema:
"run_profiling": {
"enabled": true,
"output_prefix": "onnxruntime_run_profile",
"runs": "0"
}
runs DSL: comma-separated tokens, each one of N, A-B, A-, or *.
"0" -> prefill only (default)
"1-" -> all decode steps
"0,5" -> prefill + 5th decode
"*" -> every run
Filename: <output_prefix><idx>_<ort_timestamp>.json. Run index is a
per-Generator counter (0 = prefill, N = N-th decode). Coexists with
session-level enable_profiling; both produce independent files.
Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds model.decoder.run_profiling to genai_config.json so users can profile selected session.Run() calls (e.g. only prefill, or only the N-th decode) without modifying Python code. The existing set_runtime_option('enable_profiling', ...) path already supports per- run profiling but requires API calls per experiment; this surfaces the same capability via config.
Schema:
"run_profiling": {
"enabled": true,
"output_prefix": "onnxruntime_run_profile",
"runs": "0"
}
runs DSL: comma-separated tokens, each one of N, A-B, A-, or .
"0" -> prefill only (default)
"1-" -> all decode steps
"0,5" -> prefill + 5th decode
"" -> every run
Filename: <output_prefix>_<ort_timestamp>.json. Run index is a per-Generator counter (0 = prefill, N = N-th decode). Coexists with session-level enable_profiling; both produce independent files.