Skip to content

Fix profiler#2134

Merged
astachowiczhabana merged 1 commit into
huggingface:v1.19-releasefrom
HabanaAI:fix_profiler
Jul 11, 2025
Merged

Fix profiler#2134
astachowiczhabana merged 1 commit into
huggingface:v1.19-releasefrom
HabanaAI:fix_profiler

Conversation

@astachowiczhabana
Copy link
Copy Markdown
Collaborator

This pull request introduces profiling enhancements to the text generation script (examples/text-generation/run_generation.py) by integrating a per_sequence_profiler and improving the handling of profiling during generation. The changes aim to provide more granular performance metrics and better control over profiling behavior.

Profiling Enhancements:

  • Added profiler as a parameter to the generate function, allowing the use of either disabled_profiler or per_token_profiler based on the disable_profiling flag. [1] [2]
  • Integrated per_sequence_profiler into the generation loop to measure performance at each step, including starting, stepping, and stopping the profiler at appropriate points. [1] [2] [3] [4]
  • Modified the generate_dataset function to include a disable_profiling flag, ensuring profiling can be disabled when generating datasets. [1] [2]

Code Refinements:

  • Reordered calls to timer.step() and per_sequence_profiler.stop() to ensure accurate timing and profiling data collection.

@astachowiczhabana astachowiczhabana merged commit a5500ea into huggingface:v1.19-release Jul 11, 2025
1 check passed
astachowiczhabana added a commit that referenced this pull request Aug 22, 2025
astachowiczhabana added a commit that referenced this pull request Aug 25, 2025
astachowiczhabana added a commit that referenced this pull request Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants