Skip to content
This repository was archived by the owner on Apr 23, 2026. It is now read-only.

Modify the Eval config to operate like training and serving - #1564

Merged
mergify[bot] merged 2 commits into
instructlab:mainfrom
cdoern:evalcfg
Jul 10, 2024
Merged

Modify the Eval config to operate like training and serving#1564
mergify[bot] merged 2 commits into
instructlab:mainfrom
cdoern:evalcfg

Conversation

@cdoern

@cdoern cdoern commented Jul 2, 2024

Copy link
Copy Markdown
Contributor

Training and Serving now operate under the following workflow when it comes to the config.yaml

  1. user sets the config in ilab config init
  2. user can edit portions of the config as they see fit
  3. when they run a command like ilab model serve or ilab model train the values on the cfg are flattened and used as the defaults for the cmd flags
  4. the user can at runtime override the defaults by using the flags.

Eval is a special case as it has its own cfg section but also needs to use bits from the serve portion of the cfg.

This PR flattens and includes the serve cfg in the eval default flag map. In order to make this work properly I added --backend as a flag for eval. This serves as an override depending on if the user intends to use vllm or llama-cpp.

The current code overrides some stuff manually in the serve config, I don't think we should be in the buisness of doing this behind the scenes. If the users wants to change their max-ctx-size or max_workers, they can do so in the cfg or in the flags

@mergify mergify Bot added CI/CD Affects CI/CD configuration ci-failure PR has at least one CI failure labels Jul 2, 2024
@cdoern
cdoern force-pushed the evalcfg branch 2 times, most recently from e57c91a to 77919b5 Compare July 2, 2024 15:23
@mergify mergify Bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jul 2, 2024
@mergify mergify Bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jul 2, 2024
@mergify mergify Bot removed the ci-failure PR has at least one CI failure label Jul 2, 2024
@cdoern
cdoern marked this pull request as ready for review July 2, 2024 17:45
@mergify mergify Bot added the needs-rebase This Pull Request needs to be rebased label Jul 2, 2024
@mergify

mergify Bot commented Jul 2, 2024

Copy link
Copy Markdown
Contributor

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

@mergify mergify Bot added ci-failure PR has at least one CI failure and removed needs-rebase This Pull Request needs to be rebased labels Jul 2, 2024
Comment thread src/instructlab/model/evaluate.py Outdated
Comment thread src/instructlab/model/evaluate.py Outdated
Comment thread src/instructlab/model/evaluate.py Outdated
Comment thread src/instructlab/model/evaluate.py Outdated
Comment thread src/instructlab/model/evaluate.py Outdated
Comment thread src/instructlab/model/evaluate.py Outdated
Comment thread src/instructlab/model/evaluate.py Outdated
Comment thread src/instructlab/model/evaluate.py Outdated
Comment thread src/instructlab/model/evaluate.py Outdated
Comment thread src/instructlab/model/evaluate.py Outdated
Comment thread src/instructlab/model/evaluate.py Outdated
Comment thread src/instructlab/model/evaluate.py Outdated
Comment thread src/instructlab/model/evaluate.py Outdated
Comment thread src/instructlab/model/evaluate.py Outdated
leseb
leseb previously requested changes Jul 3, 2024
Comment thread src/instructlab/model/evaluate.py Outdated
@cdoern

cdoern commented Jul 3, 2024

Copy link
Copy Markdown
Contributor Author

There seems to be some debate here over the

config -> flag overrides -> libraries design path I have been implementing across the CLI.

This is the design language I am trying to implement for each CLI cmd. I see how serving+eval is a special case because some options are only applicable to a certain backend. However, we can probably safely assume the amount of options per backend will expand over time.

I think hiding the max-ctx-size and backend flags and instead pulling them from the cfg is dangerous as it violates the design language I am trying to introduce. I know in many scenarios the user won't need to set these however, consider the following scenario I stated above:

`

The reason I did this is because of the flow we are using in the cfg.

if user has the following serve config:

serve:
backend: ''
host_port: 127.0.0.1:8000
llama_cpp:
gpu_layers: -1
llm_family: ''
max_ctx_size: 4096
model_path: models/merlinite-7b-lab-Q4_K_M.gguf
vllm:
vllm_args: []

but they change the backend manually by editing their config to:

serve:
backend: 'llama-cpp'
host_port: 127.0.0.1:8000
llama_cpp:
gpu_layers: -1
llm_family: ''
max_ctx_size: 4096
model_path: models/merlinite-7b-lab-Q4_K_M.gguf
vllm:
vllm_args: []

They run a server and a chat process and are as happy as can be.

However, the --backend evaluate flag serves as a way to NOT modify their config for all other commands (serve, chat, gen, etc) but allows them to manually set --backend=vllm just for this cmd.

I think hidden checks are useful but it is SO valuable to allow the user to override their options in the config.yaml from a UX perspective.

We are taking this approach everywhere else so I feel pretty strongly about at least exposing it here for power users.

I would be ok with some of these being hidden, but for the sake of continuity over the CLI I don't think pulling things directly out of the cfg and NOT having a flag override is something we can do

@alimaredia @leseb @nathan-weinberg WDYT?

@mergify mergify Bot removed needs-rebase This Pull Request needs to be rebased ci-failure PR has at least one CI failure labels Jul 10, 2024
@cdoern
cdoern requested a review from alinaryan July 10, 2024 14:15
@mergify mergify Bot added the ci-failure PR has at least one CI failure label Jul 10, 2024
@mergify mergify Bot removed the ci-failure PR has at least one CI failure label Jul 10, 2024
@mergify mergify Bot added the one-approval PR has one approval from a maintainer label Jul 10, 2024
Comment thread src/instructlab/model/evaluate.py Outdated

@leseb leseb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm okay with the overall approach, though I do prefer having auto-detection in place. It makes sense to have --backend for overriding.
Auto-detection is important because, without it, we risk an internal failure of the serving backend if the model and backend are incompatible. Auto-detection would prevent such issues.

This can be worked in a followup PR.
@cdoern what do you think?

@mergify

mergify Bot commented Jul 10, 2024

Copy link
Copy Markdown
Contributor

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

@mergify mergify Bot added needs-rebase This Pull Request needs to be rebased and removed one-approval PR has one approval from a maintainer labels Jul 10, 2024

@danmcp danmcp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Waiting for rebase before approving again

@mergify mergify Bot added the one-approval PR has one approval from a maintainer label Jul 10, 2024
cdoern added 2 commits July 10, 2024 15:45
this new flag is defaulted from the _serve part of the config.yaml. If the user wants to, they can override the config options by using the new flag.

Also removed two edits to the config obj. Rather than editing the config, warn the user if the options in the config may be incompatible

Signed-off-by: Charlie Doern <cdoern@redhat.com>
Signed-off-by: Charlie Doern <cdoern@redhat.com>
@mergify mergify Bot removed the needs-rebase This Pull Request needs to be rebased label Jul 10, 2024
@mergify mergify Bot removed the one-approval PR has one approval from a maintainer label Jul 10, 2024
@cdoern
cdoern dismissed nathan-weinberg’s stale review July 10, 2024 20:22

addressed comments, and nathan is on PTO. Please feel free to follow up if I missed anything!

@mergify
mergify Bot merged commit 9011bfe into instructlab:main Jul 10, 2024
Comment thread src/instructlab/model/evaluate.py
@ktam3 ktam3 added this to the 0.18.0 milestone Jul 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

CI/CD Affects CI/CD configuration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants