Skip to content

Allow max_workers to be passed in after evaluator is created#107

Merged
mergify[bot] merged 1 commit into
instructlab:mainfrom
danmcp:automaxworkers
Sep 23, 2024
Merged

Allow max_workers to be passed in after evaluator is created#107
mergify[bot] merged 1 commit into
instructlab:mainfrom
danmcp:automaxworkers

Conversation

@danmcp

@danmcp danmcp commented Aug 23, 2024

Copy link
Copy Markdown
Contributor

The reason this is necessary is serving_gpus might not be available when the evaluator is constructed. A typical flow might be:

  • Create evaluator
  • Launch server # This is when serving_gpus is probably calculated since it will depend on the model being served
  • generate
  • judge

The new logic allows for max_workers and serving_gpus to be passed in as the generate and judge steps occur.

Once all the known callers have been updated (eval and training) we can remove the two attrs from the constructors and make the logic a little simpler.

Corresponding cli change: instructlab/instructlab#2144
This change will need to be released first.

@nathan-weinberg nathan-weinberg left a comment

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.

One question but otherwise LGTM - thanks @danmcp!

Comment thread src/instructlab/eval/mt_bench.py
@nathan-weinberg
nathan-weinberg requested a review from a team September 12, 2024 15:22
@mergify mergify Bot added the one-approval label Sep 12, 2024
@mergify

mergify Bot commented Sep 13, 2024

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. @danmcp please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Sep 13, 2024
The reason this is necessary is serving_gpus might not be available when the evaluator is constructed.  A typical flow might be:

- Create evaluator
- Launch server # This is when serving_gpus is probably calculated
- generate
- judge

The new logic allows for max_workers and serving_gpus to be passed in as the generate and judge steps occur.

Once all the known callers have been updated (eval and training) we can remove the two attrs from the constructors and make the logic a little simpler.

Signed-off-by: Dan McPherson <dmcphers@redhat.com>
@mergify mergify Bot removed the needs-rebase label Sep 13, 2024
@mergify
mergify Bot merged commit 893b6ec into instructlab:main Sep 23, 2024
@mergify mergify Bot removed the one-approval label Sep 23, 2024
mergify Bot added a commit to instructlab/instructlab that referenced this pull request Sep 26, 2024
This capability takes advantage of the feature from the eval library which tunes max_workers according to the hardware configuration.  In order to accomplish this, effective gpus and max_workers="auto" needs to be passed to eval.  To accomplish this, gpus and effective gpus needed to be calculate earlier in the process.

This change also updates training to use get_gpus and max_workers=auto.  This means training now uses the gpu settings of evaluate when calling evaluate before defaulting to all gpus if not specified.

Resolves: #2079


instructlab/eval#107 is now released enabling this change.

**Checklist:**

- [ ] **Commit Message Formatting**: Commit titles and messages follow guidelines in the
  [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary).
- [ ] [Changelog](https://github.com/instructlab/instructlab/blob/main/CHANGELOG.md) updated with breaking and/or notable changes for the next minor release.
- [ ] Documentation has been updated, if necessary.
- [x] Unit tests have been added, if necessary.
- [ ] Integration tests have been added, if necessary.



Approved-by: nathan-weinberg

Approved-by: alimaredia
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.

3 participants