Skip to content

Commit 5ce9c17

Browse files
committed
minor bugfixes
1 parent 79c8c9f commit 5ce9c17

5 files changed

Lines changed: 7 additions & 8 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ and sets this in relation to the GPU's speed of light (SOL), i.e., the fastest p
103103

104104
### Inspecting the logs
105105
After 50 steps, the training will finish, and save the final model to `model.safetensors`. In addition, a log file will be created,
106-
which contains the training log in JSON format. We can visualize the log using the [plot_training_run.py](scripts/plot_training_run.py) utility script:`
106+
which contains the training log in JSON format. We can visualize the log using the [plot_training_run.py](scripts/plot_training_run.py) utility script:
107107
```shell
108108
uv run scripts/plot_training_run.py log.json
109109
```
@@ -281,14 +281,14 @@ For the optimizer state, this will slow down the optimizer step drastically (mem
281281
## Python bindings
282282
While it is nice to demonstrate training in pure C++/Cuda, there are scenarios where it is desirable to use Python for training, e.g., when using an alternative learning-rate schedule.
283283

284-
The Python bindings are provided in the `src/bindings` directory, and can be built using the
284+
The Python bindings are provided in the `src/binding` directory, and can be built using the
285285
`_pyllmq` target. The library can be built manually (`-DPYTHON_BINDING=ON`), or directly into a wheel file
286286
using `uv build --wheel`.
287287
The [demo.py](scripts/demo.py) script provides an example of how to use the bindings. Running it with `uv run pyllmq-demo` will trigger the wheel build automatically.
288288

289289
Pre-built wheels are available from [GitHub Releases](https://github.com/IST-DASLab/llmq/releases) for convenience.
290-
Download the latest `.whl` file and install it with `uv pip install 'pyllmq-0.2.0-cp312-abi3-linux_x86_64.whl[scripts]'`,
291-
or run example scripts directly: `uv run --with 'pyllmq-0.2.0+cu128-cp312-abi3-linux_x86_64.whl[scripts]' pyllmq-demo`, replacing the file name as appropriate. The `[scripts]` extra installs additional packages that aren't strictly required for pyllmq, but are used in the utility scripts, such as `datasets` and `matplotlib`.
290+
Download the latest `.whl` file and install it with `uv pip install 'pyllmq-0.3.2-cp312-abi3-linux_x86_64.whl[scripts]'`,
291+
or run example scripts directly: `uv run --with 'pyllmq-0.3.2+cu128-cp312-abi3-linux_x86_64.whl[scripts]' pyllmq-demo`, replacing the file name as appropriate. The `[scripts]` extra installs additional packages that aren't strictly required for pyllmq, but are used in the utility scripts, such as `datasets` and `matplotlib`.
292292
The wheels are built against CUDA 12.8 and 13.0 and support compute capabilities 89, 90, 100f, and 120f.
293293

294294
By design, the bindings expose only coarse-grained operations; that is, the minimum unit

doc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ for (int step = latest_step; step < MaxSteps; ++step) {
1111
for (int j = 0; j < GradAccSteps; ++j) {
1212
train_loader.load_batch(inputs, targets);
1313
model.forward(inputs, comm, j);
14-
model.backward(inputs, targets, comm, GradAccSteps, j);
14+
model.backward(inputs, targets, comm, 0.0f, GradAccSteps, j);
1515
}
1616

1717
float lr = schedule.get_lr(step);

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ scripts = [
4747
"wandb>=0.21.1",
4848
"lm-eval>=0.4.9",
4949
"pandas>=2.3.1",
50-
"plotly[express]>=6.3.0",
5150
]
5251

5352
[project.urls]

scripts/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def run_training_loop(config: pyllmq.TrainingConfig, trainer: pyllmq.LLMQTrainer
265265

266266
# Final evaluation
267267
print("\nRunning final evaluation...")
268-
final_loss, _ = run_evaluation(trainer, eval_loader, in_tokens, out_tokens, eval_loader.num_chunks)
268+
final_loss, final_loss_1k, eval_ms = run_evaluation(trainer, eval_loader, in_tokens, out_tokens, eval_loader.num_chunks)
269269
print(f"Final validation loss: {final_loss:.4f}")
270270

271271

src/binding/binding.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ NB_MODULE(_pyllmq, m) {
122122
.def_rw("num_hidden_layers", &TransformerConfig::NumLayers)
123123
.def_rw("max_position_embeddings", &TransformerConfig::MaxPositionEmbeddings)
124124
.def_rw("rope_theta", &TransformerConfig::RopeTheta)
125-
.def_rw("rms_norm_eps", &TransformerConfig::RopeTheta)
125+
.def_rw("rms_norm_eps", &TransformerConfig::RmsNormEps)
126126
.def_rw("tie_word_embeddings", &TransformerConfig::TiedWordEmbeddings)
127127
.def_rw("use_qkv_bias", &TransformerConfig::UseQKVBias)
128128
.def_prop_rw("dtype",

0 commit comments

Comments
 (0)