Skip to content
Merged
9 changes: 5 additions & 4 deletions playbooks/core/pytorch-rocm-llms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ pytorch-env\Scripts\activate
<!-- @os:windows -->
<!-- @test:id=install-deps timeout=300 setup=activate-venv -->
```bash
pip install transformers==4.57.1 safetensors==0.6.2 accelerate sentencepiece protobuf
pip install transformers==5.10.1 safetensors accelerate sentencepiece protobuf
```
<!-- @test:end -->
<!-- @os:end -->

<!-- @os:linux -->
<!-- @test:id=install-deps timeout=300 setup=activate-venv -->
```bash
pip install transformers safetensors accelerate sentencepiece protobuf
pip install transformers==5.10.1 safetensors accelerate sentencepiece protobuf
```
<!-- @test:end -->
<!-- @os:end -->
Expand All @@ -136,7 +136,7 @@ pip install transformers==5.10.1 safetensors accelerate sentencepiece protobuf
<!-- @os:linux -->
<!-- @test:id=install-deps timeout=300 setup=activate-venv -->
```bash
pip install "transformers>=5.9.0" safetensors accelerate sentencepiece protobuf
pip install transformers==5.10.1 safetensors accelerate sentencepiece protobuf
```
<!-- @test:end -->
<!-- @os:end -->
Expand Down Expand Up @@ -208,7 +208,8 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto"
device_map="auto",
disable_mmap=True
Comment thread
lucbruni-amd marked this conversation as resolved.
)
```
<!-- @test:end -->
Expand Down
2 changes: 2 additions & 0 deletions playbooks/core/pytorch-rocm-llms/assets/run_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def load_model(model_name):
model_name,
torch_dtype=torch.bfloat16,
device_map="auto",
disable_mmap=True,
)
except (ValueError, KeyError):
# Vision-language checkpoints (e.g. Qwen3.5) are not registered under
Expand All @@ -57,6 +58,7 @@ def load_model(model_name):
model_name,
torch_dtype=torch.bfloat16,
device_map="auto",
disable_mmap=True,
)
return tokenizer, model

Expand Down
2 changes: 2 additions & 0 deletions playbooks/core/pytorch-rocm-llms/assets/summarizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def __init__(self, model=DEFAULT_MODEL):
self.model_name,
torch_dtype=torch.bfloat16,
device_map=device, # whole model on one device; no CPU/meta offload
disable_mmap=True,
)
except (ValueError, KeyError):
# Vision-language checkpoints (e.g. Qwen3.5) are not registered
Expand All @@ -74,6 +75,7 @@ def __init__(self, model=DEFAULT_MODEL):
self.model_name,
torch_dtype=torch.bfloat16,
device_map=device, # whole model on one device; no CPU/meta offload
disable_mmap=True,
)
print("[OK] Model ready!\n")

Expand Down
Loading