NeMo icon indicating copy to clipboard operation
NeMo copied to clipboard

Restore PTQ tests for Llama2

Open janekl opened this issue 1 year ago • 0 comments

What does this PR do ?

Restoring PTQ tests for Llama2 model. The tests are moved here from recently disabled Jenkinsfile.

Testing all methods: FP8, INT8 SQ, INT4 AWQ and special case of NULL (just weights export step).

Collection: NLP

Changelog

  • Setting up data and models
  • Testing PTQ script (four variants)

Usage

If you want to reproduce tests locally, scripts included in tests.setup module along with convert_llama_hf_to_nemo.py can be used to create tiny test model and data with the following steps (set TEST_DATA variable accordingly):

python tests/setup/data/create_sample_jsonl.py \
  --output_file ${TEST_DATA}/test_quantization/test.json

python tests/setup/models/create_hf_model.py \
  --model_name_or_path meta-llama/Llama-2-7b \
  --output_dir ${TEST_DATA}/llama-ci-hf-tiny \
  --config_updates '{"hidden_size": 256, "num_attention_heads": 4, "num_hidden_layers": 2, "num_key_value_heads": 4}'

python scripts/checkpoint_converters/convert_llama_hf_to_nemo.py \
  --input_name_or_path ${TEST_DATA}/llama-ci-hf-tiny \
  --output_path ${TEST_DATA}/llama_ci.nemo

Jenkins CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

There's no need to comment jenkins on the PR to trigger Jenkins CI. The GitHub Actions CI will run automatically when the PR is opened. To run CI on an untrusted fork, a NeMo user with write access must click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • [x] Make sure you read and followed Contributor guidelines
  • [x] Did you write any new necessary tests?
  • [x] Did you add or update any necessary documentation?
  • [ ] Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • [ ] Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • [ ] New Feature
  • [x] Bugfix
  • [ ] Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed. Contributor guidelines contains specific people who can review PRs to various areas.

janekl avatar Apr 23 '24 12:04 janekl