-
Notifications
You must be signed in to change notification settings - Fork 48
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
Install Acceleration Framework into Training Script #157
Conversation
7b5e354
to
6095b09
Compare
from DM - It would be great if there was a way to pass a Python dataclass instead of yaml file we can create a new GPTQ-LOra config here https://github.com/foundation-model-stack/fms-hf-tuning/blob/main/tuning/config/peft_config.py#L21 Inside fms-tuning, we know for GPTQ-Lora we need to call AccelerationFramework() -> can we convert to a Python dataclass object accepted by AccelerationFramework -AccelerationFramework(qLORAcONFIG ) You know what dataclass instance it is so you can parse params from that we can implement this in steps though instead of requiring too much change to your framework- if we do step 1, we can merge code and get it working, while working on step 2 as enhancement We are discussing if we need 1 dataclass or multiple, but we can start with step 1 with dataclass only in tuning and see how it goes |
@Ssukriti @alex-jw-brooks I have made the requested changes:
Notes:
|
cf23771
to
96ad8bf
Compare
@fabianlim thank you for the redesign and the accelerationframework unit tests. Design looks good, so no major changes needed. Just few comments:
|
@Ssukriti thank you for reviewing!
The
Actually I think you are referring to this kind of test. We do already have one.
ok np! |
@Ssukriti I have added a set of extra tests These tests involve calling Therefore, I have added the following integration tests:
|
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.
will approve after conflicts are merged and all checks pass. Suggested minor edits to make it clear that GPTQLora needs a peft_config.LORAconfig passed. we have to make that clear in our documentation as users of tuning will not know that.
Remaining work in subsequent PRs after this PR is merged:
- we need to ensure that in CI/CD all the tests run regularly and they are not skipped. That means all dependencuies should be installed for our tests to run regularly . Purpose is to ensure with every release, all tests pass.
- Unit tests - Additional unit tests added are good, thank you. I did want to ensure model after tuning after GPTQLora is of correct format , and can be loaded and inferred correctly. We have had issues in past, when something would change and model format produced is no longer correct - we should have tests to capture that to have full confidence (will DM about this)
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Description of the change
This PR installs the Acceleration Framework into the
sft_trainer.py
. This is a followup to #119 which proposes to have a lightweight integration; the implementation of Acceleration Framework is kept seperate in the repo fms-acceleration under the samefoundation-model-stack
org.introduce a
AccelerationFrameworkArguments
that accepts an--acceleration_framework_config_file
argument to configure the framework.update
pyproject.toml
with an optional dependency[fms-accel]
that installs the fms-acceleration framework.update
README.md
to include basic usage offms-acceleration
, using it to perform accelerated PEFT with a 4bit GPTQ-LoRA.ensure that the integration within
sft_trainer.py
is optional, the.get_framework
call below will silently disable framework iffms-accel
dependency is not desired.restrict to only three integration points within
sft_trainer.py
script:framework.model_loader
: load model ifframework.requires_custom_loading == True
framework.augmentation
: load ifframework.requires_agumentation == True
framework.get_callbacks_and_ready_for_train
: get callbacks and do final prep onmodel
andtrainer.accelerator
if required.Update: Picture has been changed to reflect new dataclass arguments flow
Related issue number
Related to the merged PR #119 for the ADR of Training Acceleration.
How to verify the PR
This PR can be verified in the following ways:
tests/acceleration
, see Note-for-unit-tests below.Note for unit tests
For
tests/acceleration
, note thattestenv
will not install.fms-accel
dependencies, so some of the newly added tests wil be skipped. So to run all the new tests:Was the PR tested