-
Notifications
You must be signed in to change notification settings - Fork 17
Add YAML-based configuration support for vLLM main #116
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments. Also remember to update any other app that uses Policy after making the policy changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this, I left some comments on config stricture but this should be good.
apps/grpo/llama3_8b.yaml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be organized by service name:
trainer:
model:
dataset:
...
service: # for service config
policy:
...
service:
replay_buffer:
...
service
...
But also I'd leave grpo for a followup PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed for now. Will open a followup PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Submitted the followup PR here #141
src/forge/actors/policy.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to pull changes from main here, maybe this can inherit from GuidedDecoding in vLLM too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased. Will leave the inheritance to future PR.
src/forge/actors/policy.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read it here that tensor_parallel_size
is under EngineConfig.parallel_config.tensor_parallel_size
. If so, Is this implementation correct? Should the user pass the value like this instead:
policy:
engine_params:
parallel_config:
tensor_parallel_size = 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I comment on this below, what we have is fine since parallel_config doesn't actually exist until create_engine_config
is called
apps/vllm/main.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems funky
Does Policy need the service configs args?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They all do, every service needs it's own config for the resources it'll get. See previous comment for how this can be made smoother
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be missing something, but where does Policy use cfg.policy.service
apps/vllm/llama3_8b.yaml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope for this PR, but we should think about the "service in yaml pattern" when we have some breathing room
We're gonna have a pattern of excluding this field when passings args around (since X.service
is not a common Agent Arg)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you be more clear with the suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally think we should have spawn_service handle this to make it less awkward but we can do that later.
Something like
await spawn_service(Policy, **cfg.policy)
where spawn_service(actor: Actor, service_config: ServiceConfig | Mapping, **kwargs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, no action required here
Seconding the API too
src/forge/actors/policy.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we allowing Mapping as an input type just to work around the yaml?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to change anything here, but worth us thinking about down the line if we should shim this out across the repo (abstration that handles all the class constructions, actors can act on pure python) so that the actor logic is simpler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable. I agree. Let's not include it in this PR for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can we make this a physical test artifact file instead of the tempfile if we're testing loading?
maybe unit_tests/resources/test_policy.yaml
Co-authored-by: Jack-Khuu <jack.khuu.7@gmail.com>
Co-authored-by: Jack-Khuu <jack.khuu.7@gmail.com>
Co-authored-by: Jack-Khuu <jack.khuu.7@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I left a few final comments for things to change but I'll approve this now so you can land afterwards.
apps/vllm/main.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there's duplicate logic here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this!!
Commented on some code that got duplicated from code suggestions/rebase, but that's it
PolicyConfig
WorkerConfig
inheritEngineArgs
and addedfrom_dict
toWorkerConfig
.WorkerConfig
toEngineConfig
SamplingOverrides
toSamplingConfig
__post_init__
to usefrom_dict
when a dict is passed.Test Run vllm/main:
Test Run grpo/main:
Unit test
Test
vllm_args
I tested with
vllm_args