eltociear/pytorch-tasks-v1
pytorch-tasks-v1 Task dataset for a PyTorch RL / eval environment, in the shape used by the Prime Intellect Environments Hub. 45 PyTorch tasks across 5 categories. Each task gives the model one or more input tensors and an instruction; the answer is the tensor left in result, graded with torch.allclose against a reference. Grading is deterministic — no LLM judge, no external API, CPU only. Category Tasks Covers tensor_ops 16 reshape, transpose, axis reductions, clamp… See the full description on the dataset page: https://huggingface.co/datasets/eltociear/pytorch-tasks-v1.
pytorch-tasks-v1
Task dataset for a PyTorch RL / eval environment, in the shape used by the Prime Intellect Environments Hub.
45 PyTorch tasks across 5 categories. Each task gives the model one or more input tensors and an instruction; the answer is the tensor left in result, graded with torch.allclose against a reference. Grading is deterministic — no LLM judge, no external API, CPU only.
Fields
Tensors serialise as {"data": <nested list>, "dtype": <torch dtype without the prefix>, "shape": [...]}.
How it was built, and why you can trust the answer key
Tasks are defined as (deterministic input tensors, instruction, reference solution). The expected output is computed by executing the reference, never written by hand, so the key cannot drift from the instruction.
Every task is then independently verified:
- the reference runs and returns a real-valued tensor
- it is deterministic (executed twice, compared exactly)
- the result is finite — no NaN or inf in the answer key
- the result is non-empty and not identical to its input
- both the result and every input tensor survive the serialisation round-trip exactly, dtype and shape included
All 45 pass on torch 2.13.0+cpu. Builder and verifier: `build_tasks.py`.
Why the nn layers use explicit weights
Linear, Conv2d and Embedding here are filled with arange/linspace/constant weights rather than manual_seed plus default initialisation. Default initialisers and RNG stream details are implementation choices that have changed between PyTorch releases; arange cannot. A dataset whose labels silently change under pip install -U torch would be worse than no dataset.
A note on grading tolerance
Grading uses torch.allclose (rtol 1e-5, atol 1e-7) rather than exact equality: matmul, convolution and pooling dispatch to BLAS/oneDNN kernels whose last bits legitimately differ across builds and architectures. Shape is compared exactly, and an integer-valued reference requires an integer answer, so the tolerance never launders a wrong-shaped or wrong-typed result.
