Skip to content

Commit 7f8c695

Browse files
author
JacoCheung
committed
Move root RM env setting up to training
1 parent d0f528c commit 7f8c695

File tree

4 files changed

+247
-292
lines changed

4 files changed

+247
-292
lines changed

README.md

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -35,44 +35,6 @@ The project includes:
3535
</details>
3636
For more detailed release notes, please refer our [releases](https://github.com/NVIDIA/recsys-examples/releases).
3737

38-
# Environment Setup
39-
## Start from dockerfile
40-
41-
We provide [dockerfile](./docker/Dockerfile) for users to build environment.
42-
```
43-
docker build -f docker/Dockerfile --platform linux/amd64 -t recsys-examples:latest .
44-
```
45-
If you want to build image for Grace, you can use
46-
```
47-
docker build -f docker/Dockerfile --platform linux/arm64 -t recsys-examples:latest .
48-
```
49-
You can also set your own base image with args `--build-arg <BASE_IMAGE>`.
50-
51-
## Start from source file
52-
Before running examples, build and install libs under corelib following instruction in documentation:
53-
- [HSTU attention documentation](./corelib/hstu/README.md)
54-
- [Dynamic Embeddings documentation](./corelib/dynamicemb/README.md)
55-
56-
On top of those two core libs, Megatron-Core along with other libs are required. You can install them via pypi package:
57-
58-
```bash
59-
pip install torchx gin-config torchmetrics==1.0.3 typing-extensions iopath megatron-core==0.9.0
60-
```
61-
62-
If you fail to install the megatron-core package, usually due to the python version incompatibility, please try to clone and then install the source code.
63-
64-
```bash
65-
git clone -b core_r0.9.0 https://github.com/NVIDIA/Megatron-LM.git megatron-lm && \
66-
pip install -e ./megatron-lm
67-
```
68-
69-
We provide our custom HSTU CUDA operators for enhanced performance. You need to install these operators using the following command:
70-
71-
```bash
72-
cd /workspace/recsys-examples/examples/hstu && \
73-
python setup.py install
74-
```
75-
7638
# Get Started
7739
The examples we supported:
7840
- [HSTU recommender examples](./examples/hstu/README.md)

examples/hstu/training/README.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,43 @@
11
# HSTU Training example
2-
We have supported both retrieval and ranking model whose backbones are HSTU layers. In this example collection, we allow user to specify the model structures via gin-config file. Supported datasets are listed below. Regarding the gin-config interface, please refer to [here](../utils/gin_args_doc.md) .
2+
We have supported both retrieval and ranking model whose backbones are HSTU layers. In this example collection, we allow user to specify the model structures via gin-config file. Supported datasets are listed below. Regarding the gin-config interface, please refer to [inline comments](../utils/gin_config_args.py) .
3+
## Environment Setup
4+
### Start from dockerfile
35

4-
## Dataset Introduction
6+
We provide [dockerfile](./docker/Dockerfile) for users to build environment.
7+
```
8+
docker build -f docker/Dockerfile --platform linux/amd64 -t recsys-examples:latest .
9+
```
10+
If you want to build image for Grace, you can use
11+
```
12+
docker build -f docker/Dockerfile --platform linux/arm64 -t recsys-examples:latest .
13+
```
14+
You can also set your own base image with args `--build-arg <BASE_IMAGE>`.
15+
16+
### Start from source file
17+
Before running examples, build and install libs under corelib following instruction in documentation:
18+
- [HSTU attention documentation](./corelib/hstu/README.md)
19+
- [Dynamic Embeddings documentation](./corelib/dynamicemb/README.md)
20+
21+
On top of those two core libs, Megatron-Core along with other libs are required. You can install them via pypi package:
22+
23+
```bash
24+
pip install torchx gin-config torchmetrics==1.0.3 typing-extensions iopath megatron-core==0.9.0
25+
```
26+
27+
If you fail to install the megatron-core package, usually due to the python version incompatibility, please try to clone and then install the source code.
28+
29+
```bash
30+
git clone -b core_r0.9.0 https://github.com/NVIDIA/Megatron-LM.git megatron-lm && \
31+
pip install -e ./megatron-lm
32+
```
33+
34+
We provide our custom HSTU CUDA operators for enhanced performance. You need to install these operators using the following command:
35+
36+
```bash
37+
cd /workspace/recsys-examples/examples/hstu && \
38+
python setup.py install
39+
```
40+
### Dataset Introduction
541

642
We have supported several datasets as listed in the following sections:
743

@@ -20,8 +56,18 @@ refer to [KuaiRand](https://kuairand.com/) for details.
2056

2157
## Running the examples
2258

23-
Before getting started, please make sure that all pre-requisites are fulfilled. You can refer to [Get Started][../../../README] section in the root directory of the repo to set up the environment.****
59+
Before getting started, please make sure that all pre-requisites are fulfilled. You can refer to [Get Started](../../../README) section in the root directory of the repo to set up the environment.
60+
2461

62+
### Dataset preprocessing
63+
64+
In order to prepare the dataset for training, you can use our `preprocessor.py` under the hstu example folder of the project.
65+
66+
```bash
67+
cd <root-to-repo>/examples/hstu &&
68+
mkdir -p ./tmp_data && python3 ./preprocessor.py --dataset_name <"ml-1m"|"ml-20m"|"kuairand-pure"|"kuairand-1k"|"kuairand-27k">
69+
70+
```
2571

2672
### Start training
2773
The entrypoint for training are `pretrain_gr_retrieval.py` or `pretrain_gr_ranking.py`. We use gin-config to specify the model structure, training arguments, hyper-params etc.

examples/hstu/utils/gin_args_doc.md

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

0 commit comments

Comments
 (0)