Skip to content

Commit 7ccea79

Browse files
committed
Cleaned old docs
1 parent edb3ade commit 7ccea79

File tree

294 files changed

+94
-33555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+94
-33555
lines changed

docs/getting-started.md

Lines changed: 73 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,71 @@
1+
# Getting Started with MLC Script Automation
12

2-
# Getting Started with CM Script Automation
3+
## Running MLC Scripts
34

4-
## Running CM Scripts
5-
6-
To execute a simple script in CM that captures OS details, use the following command:
5+
To execute a simple script in MLC that captures OS details, use the following command:
76

87
```bash
9-
cm run script --tags=detect,os -j
8+
mlcr detect,os -j
109
```
10+
* Here, `mlcr` is a shortform for `mlc run script --tags=`
1111

1212
This command gathers details about the system on which it's run, such as:
1313

1414
```json
15-
{
16-
"CM_HOST_OS_TYPE": "linux",
17-
"CM_HOST_OS_BITS": "64",
18-
"CM_HOST_OS_FLAVOR": "ubuntu",
19-
"CM_HOST_OS_FLAVOR_LIKE": "debian",
20-
"CM_HOST_OS_VERSION": "24.04",
21-
"CM_HOST_OS_KERNEL_VERSION": "6.8.0-45-generic",
22-
"CM_HOST_OS_GLIBC_VERSION": "2.39",
23-
"CM_HOST_OS_MACHINE": "x86_64",
24-
"CM_HOST_OS_PACKAGE_MANAGER": "apt",
25-
"CM_HOST_OS_PACKAGE_MANAGER_INSTALL_CMD": "DEBIAN_FRONTEND=noninteractive apt-get install -y",
26-
"CM_HOST_OS_PACKAGE_MANAGER_UPDATE_CMD": "apt-get update -y",
27-
"+CM_HOST_OS_DEFAULT_LIBRARY_PATH": [
15+
$ mlcr detect,os -j
16+
[2025-02-03 04:57:23,449 main.py:694 INFO] - Repos path for Index: /home/arjun/MLC/repos
17+
[2025-02-03 04:57:24,167 main.py:837 INFO] - Shared index for script saved to /home/arjun/MLC/repos/index_script.json.
18+
[2025-02-03 04:57:24,167 main.py:837 INFO] - Shared index for cache saved to /home/arjun/MLC/repos/index_cache.json.
19+
[2025-02-03 04:57:24,167 main.py:837 INFO] - Shared index for experiment saved to /home/arjun/MLC/repos/index_experiment.json.
20+
[2025-02-03 04:57:24,210 module.py:574 INFO] - * mlcr detect,os
21+
[2025-02-03 04:57:24,213 module.py:5354 INFO] - ! cd /mnt/arjun/MLC/repos/gateoverflow@mlperf-automations
22+
[2025-02-03 04:57:24,213 module.py:5355 INFO] - ! call /home/arjun/MLC/repos/gateoverflow@mlperf-automations/script/detect-os/run.sh from tmp-run.sh
23+
[2025-02-03 04:57:24,245 module.py:5501 INFO] - ! call "postprocess" from /home/arjun/MLC/repos/gateoverflow@mlperf-automations/script/detect-os/customize.py
24+
[2025-02-03 04:57:24,254 module.py:2195 INFO] - {
25+
"return": 0,
26+
"env": {
27+
"MLC_HOST_OS_TYPE": "linux",
28+
"MLC_HOST_OS_BITS": "64",
29+
"MLC_HOST_OS_FLAVOR": "ubuntu",
30+
"MLC_HOST_OS_FLAVOR_LIKE": "debian",
31+
"MLC_HOST_OS_VERSION": "24.04",
32+
"MLC_HOST_OS_KERNEL_VERSION": "6.8.0-52-generic",
33+
"MLC_HOST_OS_GLIBC_VERSION": "2.39",
34+
"MLC_HOST_OS_MACHINE": "x86_64",
35+
"MLC_HOST_OS_PACKAGE_MANAGER": "apt",
36+
"MLC_HOST_OS_PACKAGE_MANAGER_INSTALL_CMD": "DEBIAN_FRONTEND=noninteractive apt-get install -y",
37+
"MLC_HOST_OS_PACKAGE_MANAGER_UPDATE_CMD": "apt-get update -y",
38+
"+MLC_HOST_OS_DEFAULT_LIBRARY_PATH": [
39+
"/usr/local/lib/x86_64-linux-gnu",
40+
"/lib/x86_64-linux-gnu",
41+
"/usr/lib/x86_64-linux-gnu",
42+
"/usr/lib/x86_64-linux-gnu64",
43+
"/usr/local/lib64",
44+
"/lib64",
45+
"/usr/lib64",
46+
"/usr/local/lib",
47+
"/lib",
48+
"/usr/lib",
49+
"/usr/x86_64-linux-gnu/lib64",
50+
"/usr/x86_64-linux-gnu/lib"
51+
],
52+
"MLC_HOST_PLATFORM_FLAVOR": "x86_64",
53+
"MLC_HOST_PYTHON_BITS": "64",
54+
"MLC_HOST_SYSTEM_NAME": "arjun-spr"
55+
},
56+
"new_env": {
57+
"MLC_HOST_OS_TYPE": "linux",
58+
"MLC_HOST_OS_BITS": "64",
59+
"MLC_HOST_OS_FLAVOR": "ubuntu",
60+
"MLC_HOST_OS_FLAVOR_LIKE": "debian",
61+
"MLC_HOST_OS_VERSION": "24.04",
62+
"MLC_HOST_OS_KERNEL_VERSION": "6.8.0-52-generic",
63+
"MLC_HOST_OS_GLIBC_VERSION": "2.39",
64+
"MLC_HOST_OS_MACHINE": "x86_64",
65+
"MLC_HOST_OS_PACKAGE_MANAGER": "apt",
66+
"MLC_HOST_OS_PACKAGE_MANAGER_INSTALL_CMD": "DEBIAN_FRONTEND=noninteractive apt-get install -y",
67+
"MLC_HOST_OS_PACKAGE_MANAGER_UPDATE_CMD": "apt-get update -y",
68+
"+MLC_HOST_OS_DEFAULT_LIBRARY_PATH": [
2869
"/usr/local/lib/x86_64-linux-gnu",
2970
"/lib/x86_64-linux-gnu",
3071
"/usr/lib/x86_64-linux-gnu",
@@ -38,98 +79,24 @@ This command gathers details about the system on which it's run, such as:
3879
"/usr/x86_64-linux-gnu/lib64",
3980
"/usr/x86_64-linux-gnu/lib"
4081
],
41-
"CM_HOST_PLATFORM_FLAVOR": "x86_64",
42-
"CM_HOST_PYTHON_BITS": "64",
43-
"CM_HOST_SYSTEM_NAME": "intel-spr-i9"
82+
"MLC_HOST_PLATFORM_FLAVOR": "x86_64",
83+
"MLC_HOST_PYTHON_BITS": "64",
84+
"MLC_HOST_SYSTEM_NAME": "arjun-spr"
85+
},
86+
"state": {
87+
"os_uname_machine": "x86_64",
88+
"os_uname_all": "Linux arjun-spr 6.8.0-52-generic #53-Ubuntu SMP PREEMPT_DYNAMIC Sat Jan 11 00:06:25 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux"
89+
},
90+
"new_state": {
91+
"os_uname_machine": "x86_64",
92+
"os_uname_all": "Linux arjun-spr 6.8.0-52-generic #53-Ubuntu SMP PREEMPT_DYNAMIC Sat Jan 11 00:06:25 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux"
93+
},
94+
"deps": []
4495
}
4596
```
4697

47-
For more details on CM scripts, see the [CM documentation](index.md).
48-
49-
### Adding New CM Scripts
98+
For more details on MLC scripts, see the [MLC documentation](index.md).
5099

51-
CM aims to provide lightweight connectors between existing automation scripts and tools without substituting them. You can add your own scripts to CM with the following command, which creates a script named `hello-world`:
52-
53-
```bash
54-
cm add script hello-world --tags=hello-world,display,test
55-
```
56-
57-
This command initializes a CM script in the local repository with the following structure:
58-
59-
```
60-
└── CM
61-
├── index.json
62-
├── repos
63-
│ ├── local
64-
│ │ ├── cfg
65-
│ │ ├── cache
66-
│ │ ├── cmr.yaml
67-
│ │ └── script
68-
│ │ └── hello-world
69-
│ │ ├── _cm.yaml
70-
│ │ ├── customize.py
71-
│ │ ├── README-extra.md
72-
│ │ ├── run.bat
73-
│ │ └── run.sh
74-
│ └── mlcommons@cm4mlops
75-
└── repos.json
76-
```
77100

78101
You can also execute the script from Python as follows:
79102

80-
```python
81-
import cmind
82-
output = cmind.access({'action':'run', 'automation':'script', 'tags':'hello-world,display,test'})
83-
if output['return'] == 0:
84-
print(output)
85-
```
86-
87-
If you discover that your new script is similar to an existing script in any CM repository, you can clone an existing script using the following command:
88-
89-
```bash
90-
cm copy script <source_script> .:<target_script>
91-
```
92-
93-
Here, `<source_script>` is the name of the existing script, and `<target_script>` is the name of the new script you're creating. Existing script names in the `cm4mlops` repository can be found [here](https://github.com/mlcommons/cm4mlops/tree/mlperf-inference/script).
94-
95-
## Caching and Reusing CM Script Outputs
96-
97-
By default, CM scripts run in the current directory and record all new files there. For example, a universal download script might download an image to the current directory:
98-
99-
```bash
100-
cm run script --tags=download,file,_wget --url=https://cKnowledge.org/ai/data/computer_mouse.jpg --verify=no --env.CM_DOWNLOAD_CHECKSUM=45ae5c940233892c2f860efdf0b66e7e
101-
```
102-
103-
To cache and reuse the output of scripts, CM offers a `cache` automation feature similar to `script`. When `"cache":true` is specified in a script's metadata, CM will create a `cache` directory in `$HOME/CM/repos/local` with a unique ID and the same tags as `script`, and execute the script there.
104-
105-
Subsequent executions of the same script will reuse files from the cache, avoiding redundancy. This is especially useful for large files or data sets.
106-
107-
You can manage cache entries and find specific ones using commands like:
108-
109-
```bash
110-
cm show cache
111-
cm show cache --tags=get,ml-model,resnet50,_onnx
112-
cm find cache --tags=download,file,ml-model,resnet50,_onnx
113-
cm info cache --tags=download,file,ml-model,resnet50,_onnx
114-
```
115-
116-
To clean cache entries:
117-
118-
```bash
119-
cm rm cache --tags=ml-model,resnet50
120-
cm rm cache -f # Clean all entries
121-
```
122-
123-
You can completely reset the CM framework by removing the `$HOME/CM` directory, which deletes all downloaded repositories and cached entries.
124-
125-
## Integration with Containers
126-
127-
CM scripts are designed to run natively or inside containers with the same commands. You can substitute `cm run script` with `cm docker script` to execute a script inside an automatically-generated container:
128-
129-
```bash
130-
cm docker script --tags=python,app,image-classification,onnx,_cpu
131-
```
132-
133-
CM automatically handles the generation of Dockerfiles, building of containers, and execution within containers, providing a seamless experience whether running scripts natively or in containers.
134-
135-
This approach simplifies the development process by eliminating the need for separate Dockerfile maintenance and allows for the use of native scripts and workflows directly within containers.

docs/index.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
# CM "script" automation specification
1+
# MLC "script" automation specification
22

3-
Please check the [CM documentation](https://docs.mlcommons.org/ck) for more details about the CM automation language.
3+
Please check the [MLC documentation](https://docs.mlcommons.org/mlcflow) for more details about the MLCflow interface.
44

5-
See the [automatically generated catalog](scripts/index.md) of all CM scripts from MLCommons.
5+
See the [automatically generated catalog](scripts/index.md) of all the MLC scripts.
66

7-
## Understanding CM scripts
7+
## Understanding MLC scripts
88

9-
* A CM script is identified by a set of tags and by unique ID.
10-
* Further each CM script can have multiple variations and they are identified by variation tags which are treated in the same way as tags and identified by a `_` prefix.
9+
* An MLC script is identified by a set of tags and by an unique ID.
10+
* Further each MLC script can have multiple variations and they are identified by variation tags which are treated in the same way as tags and identified by a `_` prefix.
1111

12-
### CM script execution flow
12+
### MLC script execution flow
1313
<img src="https://github.com/mlcommons/cm4mlops/raw/mlperf-inference/automation/script/assets/scripts-workflow.png" width="248">
1414

15-
* When a CM script is invoked (either by tags or by unique ID), its `_cm.json` is processed first which will check for any `deps` script and if there are, then they are executed in order.
15+
* When an MLC script is invoked (either by tags or by unique ID), its `meta.yaml` is processed first which will check for any `deps` script and if there are, then they are executed in order.
1616
* Once all the `deps` scripts are executed, `customize.py` file is checked and if existing `preprocess` function inside it is executed if present.
17-
* Then any `prehook_deps` CM scripts mentioned in `_cm.json` are executed similar to `deps`
17+
* Then any `prehook_deps` scripts mentioned in `meta.yaml` are executed similar to `deps`
1818
* After this, keys in `env` dictionary is exported as `ENV` variables and `run` file if exists is executed.
19-
* Once run file execution is done, any `posthook_deps` CM scripts mentioned in `_cm.json` are executed similar to `deps`
19+
* Once run file execution is done, any `posthook_deps` scripts mentioned in `meta.yaml` are executed similar to `deps`
2020
* Then `postprocess` function inside customize.py is executed if present.
21-
* After this stage any `post_deps` CM scripts mentioned in `_cm.json` is executed.
21+
* After this stage any `post_deps` scripts mentioned in `meta.yaml` is executed.
2222

2323
** If a script is already cached, then the `preprocess`, `run file` and `postprocess` executions won't happen and only the dependencies marked as `dynamic` will be executed from `deps`, `prehook_deps`, `posthook_deps` and `postdeps`.
2424

2525
### Input flags
26-
When we run a CM script we can also pass inputs to it and any input added in `input_mapping` dictionary inside `_cm.json` gets converted to the corresponding `ENV` variable.
26+
When we run an MLC script we can also pass inputs to it and any input added in `input_mapping` dictionary inside `meta.yaml` gets converted to the corresponding `ENV` variable.
2727

2828
### Conditional execution of any `deps`, `post_deps`
2929
We can use `skip_if_env` dictionary inside any `deps`, `prehook_deps`, `posthook_deps` or `post_deps` to make its execution conditional
@@ -36,28 +36,28 @@ We can specify any specific version of a script using `version`. `version_max` a
3636
* When `version_max` is given, any version below this if present in the cache or detected in the system can be chosen. If nothing is detected `default_version` if present and if below `version_max` will be used for installation. Otherwise `version_max_usable` (additional needed input for `version_max`) will be used as `version`.
3737

3838
### Variations
39-
* Variations are used to customize CM script and each unique combination of variations uses a unique cache entry. Each variation can turn on `env` keys also any other meta including dependencies specific to it. Variations are turned on like tags but with a `_` prefix. For example, if a script is having tags `"get,myscript"`, to call the variation `"test"` inside it, we have to use tags `"get,myscript,_test"`.
39+
* Variations are used to customize MLC script and each unique combination of variations uses a unique cache entry. Each variation can turn on `env` keys also any other meta including dependencies specific to it. Variations are turned on like tags but with a `_` prefix. For example, if a script is having tags `"get,myscript"`, to call the variation `"test"` inside it, we have to use tags `"get,myscript,_test"`.
4040

4141
#### Variation groups
4242
`group` is a key to map variations into a group and at any time only one variation from a group can be used in the variation tags. For example, both `cpu` and `cuda` can be two variations under the `device` group, but user can at any time use either `cpu` or `cuda` as variation tags but not both.
4343

4444
#### Dynamic variations
4545
Sometimes it is difficult to add all variations needed for a script like say `batch_size` which can take many different values. To handle this case, we support dynamic variations using '#' where '#' can be dynamically replaced by any string. For example, `"_batch_size.8"` can be used as a tag to turn on the dynamic variation `"_batch_size.#"`.
4646

47-
### ENV flow during CM script execution
47+
### ENV flow during MLC script execution
4848

4949

5050
* During a given script execution incoming `env` dictionary is saved `(saved_env)` and all the updates happens on a copy of it.
5151
* Once a script execution is over (which includes all the dependent script executions as well), newly created keys and any updated keys are merged with the `saved_env` provided the keys are mentioned in `new_env_keys`
5252
* Same behaviour applies to `state` dictionary.
5353

5454
#### Special env keys
55-
* Any env key with a prefix `CM_TMP_*` and `CM_GIT_*` are not passed by default to any dependency. These can be force passed by adding the key(s) to the `force_env_keys` list of the concerned dependency.
55+
* Any env key with a prefix `MLC_TMP_*` and `MLC_GIT_*` are not passed by default to any dependency. These can be force passed by adding the key(s) to the `force_env_keys` list of the concerned dependency.
5656
* Similarly we can avoid any env key from being passed to a given dependency by adding the prefix of the key in the `clean_env_keys` list of the concerned dependency.
57-
* `--input` is automatically converted to `CM_INPUT` env key
58-
* `version` is converted to `CM_VERSION`, ``version_min` to `CM_VERSION_MIN` and `version_max` to `CM_VERSION_MAX`
59-
* If `env['CM_GH_TOKEN']=TOKEN_VALUE` is set then git URLs (specified by `CM_GIT_URL`) are changed to add this token.
60-
* If `env['CM_GIT_SSH']=yes`, then git URLs are changed to SSH from HTTPS.
57+
* `--input` is automatically converted to `MLC_INPUT` env key
58+
* `version` is converted to `MLC_VERSION`, ``version_min` to `MLC_VERSION_MIN` and `version_max` to `MLC_VERSION_MAX`
59+
* If `env['MLC_GH_TOKEN']=TOKEN_VALUE` is set then git URLs (specified by `MLC_GIT_URL`) are changed to add this token.
60+
* If `env['MLC_GIT_SSH']=yes`, then git URLs are changed to SSH from HTTPS.
6161

6262
### Script Meta
6363
#### Special keys in script meta
@@ -70,7 +70,7 @@ Sometimes it is difficult to add all variations needed for a script like say `ba
7070
* By default no depndencies are run for a cached entry unless `dynamic` key is set for it.
7171

7272

73-
Please see [here](getting-started.md) for trying CM scripts.
73+
Please see [here](getting-started.md) for trying MLC scripts.
7474

7575

7676

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ swagger-markdown
33
mkdocs-macros-plugin
44
ruamel.yaml
55
slugify
6-
mkdocs-caseinsensitive-plugin

docs/scripts/AI-ML-datasets/get-croissant/index.md

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)