Skip to content
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

[OneshotRefactor] Update oneshot to post_train #1136

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

Conversation

horheynm
Copy link
Collaborator

@horheynm horheynm commented Feb 11, 2025

Blocked on #1109 to obtain models without training_args

SUMMARY:

  • Update oneshot to post_train
  • Make post_train have its own pipeline, decoupled form main
  • Make post_train's input arguments only dependent on ModelArguments, DatasetArguments, and RecipeArguments. Any TrainingArguments-related input arg will raise an error. Ex. overwrite_output_dir.
  • Update any oneshot usage in the function name (run_oneshot_and_finetune), Enum attributes (RecipeStages), variable name (oneshot_model) to post_train`.
  • Update folder names from oneshot to post_train (ex. "tests/llmcompressor/transformers/oneshot/oneshot_configs")
  • Update cli command in setup.py
  • In stage-runner, in the logic to detect if post_train or train, change the order to detect post_train first (train is a subset, so currently train will always be detected if post_train).

TEST PLAN:

  • Pass existing tests
  • search oneshot using grep.

FOLLOWUPS:

  • Remove oneshot dependent code (ex. SessionMixin.apply)
  • Remove stage-runner

Copy link

👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review.

Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed.

return self.run_type
if StageRunType.POST_TRAIN.value in self.group:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

flip the order check if the config_name has "post_train" first before "train".

model=model,
tokenizer=tokenizer,
dataset=DATASET_ID,
recipe=recipe,
max_seq_length=MAX_SEQ_LENGTH,
num_calibration_samples=NUM_CALIBRATION_SAMPLES,
save_compressed=SAVE_COMPRESSED,
overwrite_output_dir=True,
Copy link
Collaborator Author

@horheynm horheynm Feb 11, 2025

Choose a reason for hiding this comment

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

Only used in training args, not post-train dep args. Will raise an error if present

@dsikka
Copy link
Collaborator

dsikka commented Feb 11, 2025

we should be landing the entrypoint updates, independent of changing the naming from oneshot to post_train.

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