-
Notifications
You must be signed in to change notification settings - Fork 13
Code changes for supporting llama3_1-405b reference implementation #111
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
Changes from 6 commits
e9651f0
bfb7cb6
65111e5
a21f2b0
5a4e39c
adc7143
97dd75d
f7fe010
9c15c6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -496,6 +496,24 @@ deps: | |
RGAT_CHECKPOINT_PATH: | ||
- 'on' | ||
|
||
|
||
## LLAMA3_1-405B | ||
- tags: get,ml-model,llama3 | ||
names: | ||
- llama3-405b-model | ||
- llama3-402b-model | ||
enable_if_env: | ||
CM_MODEL: | ||
- llama3_1-405b | ||
- llama3-405b | ||
skip_if_env: | ||
CM_ML_MODEL_LLAMA3_CHECKPOINT_PATH: | ||
- 'on' | ||
CM_USE_MODEL_FROM_HOST: | ||
- 'yes' | ||
CM_RUN_STATE_DOCKER: | ||
- 'yes' | ||
|
||
######################################################################## | ||
# Install datasets | ||
|
||
|
@@ -635,6 +653,24 @@ deps: | |
CM_USE_DATASET_FROM_HOST: | ||
- 'yes' | ||
|
||
## llama3_1 dataset | ||
- tags: get,dataset,mlperf,inference,llama3,_validation | ||
names: | ||
- llama3_1-dataset | ||
- llama3-dataset | ||
enable_if_env: | ||
CM_MODEL: | ||
- llama3_1-405b | ||
- llama3-402b | ||
skip_if_env: | ||
CM_DATASET_LLAMA3_PATH: | ||
- "on" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here as for the model. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated in commit bfb7cb6 |
||
CM_USE_DATASET_FROM_HOST: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This variable is not needed right? Because if the path is directly passed from the host to a container then, this won't work. Same for model. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's right, thanks. Also I formatted the |
||
- 'yes' | ||
CM_RUN_STATE_DOCKER: | ||
- 'yes' | ||
|
||
|
||
######################################################################## | ||
# Install MLPerf inference dependencies | ||
|
||
|
@@ -1281,6 +1317,36 @@ variations: | |
CM_TMP_GENERIC_PYTHON_PIP_EXTRA_FIND_LINKS_URL: "https://data.pyg.org/whl/torch-<<<CM_TORCH_VERSION>>>+cpu.html" | ||
CM_TMP_GENERIC_PYTHON_PIP_EXTRA_FIND_LINKS_URL_DGL: "https://data.dgl.ai/wheels/torch-<<<CM_TORCH_VERSION_MAJOR_MINOR>>>/repo.html" | ||
|
||
llama3_1-405b: | ||
group: models | ||
env: | ||
CM_MODEL: llama3_1-405b | ||
adr: | ||
pytorch: | ||
version_max: 2.5.1 | ||
CM_MODEL: llama3-402b | ||
deps: | ||
- tags: get,generic-python-lib,_package.torchvision | ||
- tags: get,generic-python-lib,_package.torchaudio | ||
- tags: get,generic-python-lib,_package.torch-geometric | ||
- tags: get,generic-python-lib,_package.transformers | ||
- tags: get,generic-python-lib,_package.sentencepiece | ||
- tags: get,generic-python-lib,_package.accelerate | ||
- tags: get,generic-python-lib,_package.vllm | ||
env: | ||
CM_GENERIC_PYTHON_PIP_EXTRA: "--upgrade" | ||
- tags: get,generic-python-lib,_package.pybind11 | ||
- tags: get,generic-python-lib,_package.pandas | ||
version_max: 2.2.1 | ||
|
||
llama3_1-405b,cuda: | ||
env: | ||
CM_GENERIC_PYTHON_PIP_EXTRA_FIND_LINKS_URL: "https://data.pyg.org/whl/torch-<<<CM_TORCH_VERSION>>>.html" | ||
|
||
llama3_1-405b,cpu: | ||
env: | ||
CM_GENERIC_PYTHON_PIP_EXTRA_FIND_LINKS_URL: "https://data.pyg.org/whl/torch-<<<CM_TORCH_VERSION>>>+cpu.html" | ||
|
||
# Target devices | ||
cpu: | ||
group: device | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
alias: get-dataset-mlperf-inference-llama3 | ||
automation_alias: script | ||
automation_uid: 5b4e0237da074764 | ||
cache: true | ||
tags: | ||
- get | ||
- dataset | ||
- mlperf | ||
- llama3 | ||
- inference | ||
uid: c3bc69599cbc4db7 | ||
new_env_keys: | ||
- CM_DATASET_LLAMA3_PATH | ||
input_mapping: | ||
outdirname: CM_OUTDIRNAME | ||
prehook_deps: | ||
- env: | ||
CM_DOWNLOAD_FINAL_ENV_NAME: CM_DATASET_LLAMA3_PATH | ||
CM_EXTRACT_TO_FOLDER: llama-3-dataset | ||
extra_cache_tags: dataset,llama3 | ||
force_cache: true | ||
enable_if_env: | ||
CM_TMP_REQUIRE_DOWNLOAD: | ||
- 'yes' | ||
names: | ||
- dae | ||
tags: download-and-extract | ||
update_tags_from_env_with_prefix: | ||
_url.: | ||
- CM_DOWNLOAD_URL | ||
variations: | ||
validation: | ||
default: true | ||
group: dataset-type | ||
env: | ||
CM_RCLONE_URL: mlc-inference:mlcommons-inference-wg-public/llama3_405b/mlperf_llama3.1_405b_dataset_8313_processed_fp16_eval.pkl | ||
CM_DATASET_TYPE: validation | ||
CM_DATASET_FILE_NAME: mlperf_llama3.1_405b_dataset_8313_processed_fp16_eval.pkl | ||
calibration: | ||
group: dataset-type | ||
env: | ||
CM_RCLONE_URL: mlc-inference:mlcommons-inference-wg-public/llama3_405b/mlperf_llama3.1_405b_calibration_dataset_512_processed_fp16_eval.pkl | ||
CM_DATASET_TYPE: calibration | ||
CM_DATASET_FILE_NAME: mlperf_llama3.1_405b_calibration_dataset_512_processed_fp16_eval.pkl | ||
rclone: | ||
add_deps_recursive: | ||
dae: | ||
tags: _rclone | ||
default: true | ||
env: | ||
CM_DOWNLOAD_FILENAME: checkpoint | ||
CM_DOWNLOAD_URL: <<<CM_RCLONE_URL>>> | ||
CM_RCLONE_CONFIG_NAME: mlc-inference | ||
group: download-tool | ||
print_env_at_the_end: | ||
CM_DATASET_LLAMA3_PATH: Path to the dataset |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from cmind import utils | ||
import os | ||
|
||
|
||
def preprocess(i): | ||
|
||
os_info = i['os_info'] | ||
|
||
env = i['env'] | ||
|
||
if os_info['platform'] == "windows": | ||
return {'return': 1, 'error': 'Script not supported in windows yet!'} | ||
|
||
if env.get('CM_DATASET_LLAMA3_PATH', '') == '': | ||
env['CM_TMP_REQUIRE_DOWNLOAD'] = "yes" | ||
|
||
if env.get('CM_OUTDIRNAME', '') != '': | ||
env['CM_DOWNLOAD_PATH'] = env['CM_OUTDIRNAME'] | ||
|
||
return {'return': 0} | ||
|
||
|
||
def postprocess(i): | ||
|
||
env = i['env'] | ||
|
||
if env.get('CM_TMP_REQUIRE_DOWNLOAD', '') == "yes": | ||
env['CM_DATASET_LLAMA3_PATH'] = os.path.join( | ||
env['CM_DATASET_LLAMA3_PATH'], env['CM_DATASET_FILE_NAME']) | ||
|
||
return {'return': 0} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
alias: get-ml-model-llama3 | ||
automation_alias: script | ||
automation_uid: 5b4e0237da074764 | ||
cache: true | ||
category: AI/ML models | ||
input_mapping: | ||
outdirname: CM_OUTDIRNAME | ||
new_env_keys: | ||
- CM_ML_MODEL_* | ||
- LLAMA3_CHECKPOINT_PATH | ||
prehook_deps: | ||
- enable_if_env: | ||
CM_TMP_REQUIRE_DOWNLOAD: | ||
- 'yes' | ||
env: {} | ||
extra_cache_tags: llama3,llama-3 | ||
force_env_keys: | ||
- CM_GIT_CHECKOUT_FOLDER | ||
names: | ||
- hf-zoo | ||
tags: get,ml-model,huggingface,zoo,_clone-repo | ||
print_env_at_the_end: | ||
LLAMA3_CHECKPOINT_PATH: LLAMA3 checkpoint path | ||
tags: | ||
- get | ||
- raw | ||
- ml-model | ||
- language-processing | ||
- llama3 | ||
- llama3-405b | ||
uid: 2f8cef2acc334e80 | ||
variations: | ||
fp16: | ||
default: true | ||
env: | ||
CM_ML_MODEL_INPUT_DATA_TYPES: fp16 | ||
CM_ML_MODEL_PRECISION: fp16 | ||
CM_ML_MODEL_WEIGHT_DATA_TYPES: fp16 | ||
group: precision | ||
meta-llama/Llama-3.1-405B-Instruct: | ||
adr: | ||
hf-zoo: | ||
tags: _model-stub.meta-llama/Llama-3.1-405B-Instruct | ||
default: true | ||
env: | ||
CM_ML_MODEL_NAME: Llama-3-405b-instruct | ||
CM_MODEL_ZOO_ENV_KEY: LLAMA3 | ||
group: huggingface-stub | ||
meta-llama/Llama-3.1-8B-Instruct: | ||
adr: | ||
hf-zoo: | ||
tags: _model-stub.meta-llama/Llama-3.1-8B-Instruct | ||
env: | ||
CM_ML_MODEL_NAME: Llama-3-8b-instruct | ||
CM_MODEL_ZOO_ENV_KEY: LLAMA3 | ||
group: huggingface-stub | ||
vllm: | ||
default: true | ||
env: | ||
CM_ML_MODEL_FRAMEWORK: vllm | ||
group: framework | ||
stub.#: | ||
adr: | ||
hf-zoo: | ||
tags: _model-stub.# | ||
env: | ||
CM_MODEL_ZOO_ENV_KEY: LLAMA3 | ||
group: huggingface-stub |
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.
Also only if we are in the docker build stage. Otherwise when the path is given we should register it in CM cache
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.
Updated in commit bfb7cb6