You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prep for CRAN: docs, examples, DESCRIPTION, wire up missing C bindings
DESCRIPTION rewritten for CRAN: title and description narrowed to
Linux-focused libtorch bindings, Cornball AI added as copyright holder
to match LICENSE, ORCID on the maintainer, single-quoted software
names, pytorch cppdocs URL angle-bracketed and updated to the new host,
OS_type: unix.
Deleted R/zzz-compat-ops.R (1108 lines of auto-generated torch wrappers
with no callers, riddled with undefined helpers copied from the 'torch'
R package). Killed the only glue::glue usage while we were in there.
Wired three C++ functions that had implementations in src/gen-ops.cpp
but were never registered with R, so their R wrappers were effectively
stubs:
- cuda_synchronize() now walks every CUDA device and calls
cudaDeviceSynchronize(). CUDA work is NOT implicitly synced at the R
boundary; explicit sync matters for benchmarking and surfacing async
errors. Added a new C_cuda_synchronize in src/tensor.cpp.
- torch_manual_seed() now calls at::manual_seed(). Verified
reproducibility across torch_randn() calls.
- torch_scaled_mm() now calls at::_scaled_mm(). Verified with an FP8
matmul on CUDA.
Each got matching stubs in src/stubs.c, entries in init.cpp's
CallEntries table, Rcpp wrappers in RcppExports.cpp, and R bindings in
R/RcppExports.R.
Example coverage: 270 examples copied verbatim from the 'torch' R
package via tools/copy_examples.R (matched by topic name), 56
hand-written stubs for functions with no torch counterpart, and 650+
template examples pointing at the upstream PyTorch docs for the
mechanical torch_* wrappers. All examples are wrapped in
\\donttest{if (torch_is_installed()) { ... }}.
Parameter docs: tools/add_param_docs.R parses function signatures,
diffs against existing @param lines, and fills in missing ones from a
small type-aware description table. 306 @param lines added across the
generated op wrappers and the hand-written compat shims.
Other fixes: -2147483648L integer literal in torch_iinfo() (triggered
'non-integer value ... qualified with L'), torch::cuda_is_available()
references in examples switched to the tinytorch-local function, stale
tinytorch_0.1.0.tar.gz / tinytorch.Rcheck / tinyrox*.log cleaned up
and added to .Rbuildignore.
Status: 0 errors, 0 warnings, 2 notes. The remaining notes are the
private cornball-ai/tinytorch URL (will 404 until the repo is public)
and the standard Debian/Ubuntu system-R compile flags.
NEWS.md and cran-comments.md added.
* First submission target. Package now builds cleanly against 'libtorch' 2.11.0 on Linux and falls back to a stub backend on other Unix platforms so install always succeeds.
6
+
*`DESCRIPTION` rewritten for CRAN: single-quoted software names, angle-bracketed upstream URL, ORCID, and `Cornball AI` as copyright holder matching `LICENSE`.
7
+
* Removed the `glue` import. The package now has a single hard dependency on `Rcpp`.
8
+
* Dropped `R/zzz-compat-ops.R`, a stale set of 38 auto-generated wrappers copied from the 'torch' R package that were never wired up and relied on helpers tinytorch does not provide.
9
+
* Fixed a parse warning in `torch_iinfo()` caused by the `-2147483648L` integer literal.
10
+
*`cuda_synchronize()`, `torch_manual_seed()`, and `torch_scaled_mm()` now actually call libtorch. Previous versions had the C++ implementations in `src/gen-ops.cpp` but never registered them with R, so the R wrappers were effectively stubs. `torch_manual_seed()` now seeds libtorch's global generator (confirmed reproducible across `torch_randn()` calls). `cuda_synchronize()` walks every CUDA device and calls `cudaDeviceSynchronize()` — necessary for correct benchmarking and for surfacing async CUDA errors at a specific line.
11
+
12
+
## Dispatch and coverage
13
+
14
+
* Full dispatch table coverage plus autograd and optimizers (#5).
0 commit comments