Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Conversation

@bfineran
Copy link

@bfineran bfineran commented Aug 30, 2021

to perform pruning and QAT phases in the same recipe, it is useful to control the LR schedule within the recipe. currently, the HF LR scheduler will be called after the sparseml step, overriding any LR Modifiers. This PR detects if there are any LR modifiers in a Trainer's recipe, and if so, sets the HF LR scheduler to a dummy one.

example LR schedule recipe for pruning+QAT:

training_modifiers:
  - !EpochRangeModifier
    end_epoch: *num_epochs
    start_epoch: 0.0
    
  - !LearningRateFunctionModifier
    start_epoch: 0.0
    end_epoch: *quantization_start_epoch
    lr_func: linear
    init_lr: *init_lr
    final_lr: 0.0
    
  # reset LR schedule for QAT
  - !LearningRateFunctionModifier
    start_epoch: *quantization_start_epoch
    end_epoch: *num_epochs
    lr_func: linear
    init_lr: *init_lr
    final_lr: 0.0

Produced schedule from W&B:
Screen Shot 2021-08-30 at 4 40 38 PM

W&B: https://wandb.ai/neuralmagic/huggingface/runs/40ycsv8g?workspace=user-neuralmagic

@bfineran bfineran requested review from markurtz and natuan August 30, 2021 20:57
@bfineran bfineran self-assigned this Aug 30, 2021
@bfineran bfineran requested review from a team and horheynm and removed request for a team August 30, 2021 20:57
@bfineran bfineran merged commit 6db8c9e into master Aug 31, 2021
@natuan natuan deleted the lr-modifiers branch October 18, 2021 18:49
bfineran pushed a commit that referenced this pull request Jun 5, 2024
* Cohere Model Release (#1)

Cohere Model Release

* Remove unnecessary files and code (#2)

Some cleanup

* Delete cohere-model directory (#3)

* Make Fix (#5)

* Pr fixes (#6)

* fixes for pr

* pr fixes for the format

* pr fixes for the format

* src/transformers/models/auto/tokenization_auto.py

* Tokenizer test (#8)

* tokenizer test

* format fix

* Adding Docs and other minor changes (#7)

* Add modeling tests (#9)

* Smol Fix (#11)

* tokenization tests are fixed

* format fixes

* fix pr doc tests

* fix pr doc tests

* fix pr doc tests

* fix pr style check

* small changes in cohere.md

* FIX: Address final comments for transformers integration (#13)

* fix modeling final nits and add proper test file

* for now leave empty tests

* add integration test

* push new test

* fix modeling cohere (#14)

* Update chat templates to use the new API (#15)

---------

Co-authored-by: ahmetustun <[email protected]>
Co-authored-by: Younes Belkada <[email protected]>
Co-authored-by: Matt <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants