Skip to content

Commit

Permalink
Cran/v0.14.0 (#1265)
Browse files Browse the repository at this point in the history
* Prepare for CRAN

* Increment version number to 0.14.0

* Don't depend on dev Rcpp

* Fix 404 URL

* Polish NEWS

* Fix `Tuple[int]` to avoid a missing link

* Improve error message for `nn_sequential` + fix linalg docs.

* Remove empty line in DESCRIPTION

* Revdep check
  • Loading branch information
dfalbel authored Jan 30, 2025
1 parent 0d7ee0e commit 3a53279
Show file tree
Hide file tree
Showing 17 changed files with 313 additions and 521 deletions.
16 changes: 8 additions & 8 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ mnist-r.*
# ^vignettes/using-autograd\.Rmd

# uncomment below for CRAN submission
# ^inst/bin/.*
# ^inst/include/(?!torch.h|lantern|torch_RcppExports.h|utils.h|torch_impl.h|torch_types.h|torch_api.h|torch_deleters.h|torch_imports.h).*
# ^inst/lib/.*
# ^inst/share/.*
# ^inst/build-hash
# ^inst/build-versions
# ^src/lantern/.*
# ^tests/testthat/assets/model-v.*
^inst/bin/.*
^inst/include/(?!torch.h|lantern|torch_RcppExports.h|utils.h|torch_impl.h|torch_types.h|torch_api.h|torch_deleters.h|torch_imports.h).*
^inst/lib/.*
^inst/share/.*
^inst/build-hash
^inst/build-versions
^src/lantern/.*
^tests/testthat/assets/model-v.*

^doc$
^Meta$
Expand Down
4 changes: 1 addition & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: torch
Type: Package
Title: Tensors and Neural Networks with 'GPU' Acceleration
Version: 0.13.0.9001
Version: 0.14.0
Authors@R: c(
person("Daniel", "Falbel", email = "daniel@rstudio.com", role = c("aut", "cre", "cph")),
person("Javier", "Luraschi", email = "jluraschi@gmail.com", role = c("aut")),
Expand Down Expand Up @@ -180,5 +180,3 @@ Collate:
'variable_list.R'
'with-indices.R'
'wrapers.R'
Remotes:
RcppCore/Rcpp
18 changes: 12 additions & 6 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
# torch (development version)
# torch 0.14.0

## Breaking changes

- Updated to LibTorch v2.5.1 (#1204) -- potentially breaking change!

## New features

- Feature: Faster optimizers (`optim_ignite_<name>()`) are available: Adam, AdamW, Adagrad, RMSprop,SGD.
These can be used as drop-in replacements for `optim_<name>` but are considerably
faster as they wrap the LibTorch implementation of the optimizer.
The biggest speed differences can be observed for complex optimizers such as `AdamW`.

## Bug fixes

- `torch_iinfo()` now support all integer dtypes (#1190 @cregouby)
- Fixed float key_padding_mask in `nnf_multi_head_attention_forward()` (#1205)
- Updated to LibTorch v2.5.1 (#1204)
- Fix french translation (#1176 @cregouby)
- Trace jitted modules now respect 'train' and 'eval' mode (#1211)
- Feature: Faster optimizers (`optim_ignite_<name>()`) are available: Adam, AdamW, Adagrad, RMSprop,SGD.
These can be used as drop-in replacements for `optim_<name>` but are considerably
faster as they wrap the LibTorch implementation of the optimizer.
The biggest speed differences can be observed for complex optimizers such as `AdamW`.
* Fix: Avoid name clashes between multiple calls to `jit_trace` (#1246)

# torch 0.13.0
Expand Down
2 changes: 1 addition & 1 deletion R/install.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
branch <- "main"
branch <- "cran/v0.14.0"
torch_version <- "2.5.1"

#' Install Torch
Expand Down
4 changes: 2 additions & 2 deletions R/linalg.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#'
#' @param A (Tensor): tensor of shape `(*, n)` or `(*, m, n)` where `*` is zero or more batch dimensions
#' @param ord (int, float, inf, -inf, 'fro', 'nuc', optional): order of norm. Default: `NULL`
#' @param dim (int, Tuple[int], optional): dimensions over which to compute
#' @param dim (int, `Tuple[int]`, optional): dimensions over which to compute
#' the vector or matrix norm. See above for the behavior when `dim=NULL`.
#' Default: `NULL`
#' @param keepdim (bool, optional): If set to `TRUE`, the reduced dimensions are retained
Expand Down Expand Up @@ -1135,7 +1135,7 @@ linalg_tensorinv <- function(A, ind = 3L) {
#'
#' @param A (Tensor): tensor to solve for.
#' @param B (Tensor): the solution
#' @param dims (Tuple[int], optional): dimensions of `A` to be moved.
#' @param dims (`Tuple[int]`, optional): dimensions of `A` to be moved.
#' If `NULL`, no dimensions are moved. Default: `NULL`.
#'
#' @examples
Expand Down
10 changes: 9 additions & 1 deletion R/nn.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ nn_Module <- R6::R6Class(
name <- as.character(name)
}

if (!inherits(module, "nn_module")) {
cli::cli_abort("Expected {.cls nn_module} but got object of type {.cls {class(module)}}")
}

if (inherits(module, "nn_module_generator")) {
cli::cli_abort("Module {.str {name}} must be initialized")
}

private$modules_[[name]] <- module
},
register_parameter = function(name, param) {
Expand Down Expand Up @@ -674,7 +682,7 @@ print.nn_module <- function(x, ...) {
#' input <- torch_randn(32, 1, 28, 28)
#' output <- model(input)
#' @export
nn_sequential <- module <- nn_module(
nn_sequential <- nn_module(
classname = "nn_sequential",
initialize = function(...) {
modules <- rlang::list2(...)
Expand Down
5 changes: 2 additions & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
New release with many bug fixes and new features.

We checked 23 reverse dependencies (22 from CRAN + 1 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package.
We checked 39 reverse dependencies (37 from CRAN + 2 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package.

* We saw 1 new problems
* We failed to check 9 packages

The new failing package is luz, and a new version will be submitted shortly after.
The new problem is in torchvisionlib and we'll submit a fixed version of it shortly after the torch release.
2 changes: 1 addition & 1 deletion man/linalg_matrix_norm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/linalg_norm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/linalg_tensorsolve.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/linalg_vector_norm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 38 additions & 38 deletions revdep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,57 @@

|field |value |
|:--------|:---------------------------------|
|version |R version 4.2.2 (2022-10-31) |
|os |macOS Ventura 13.1 |
|version |R version 4.4.1 (2024-06-14) |
|os |macOS 15.1.1 |
|system |aarch64, darwin20 |
|ui |X11 |
|language |(EN) |
|collate |en_US.UTF-8 |
|ctype |en_US.UTF-8 |
|tz |Europe/Rome |
|date |2023-06-06 |
|tz |America/Sao_Paulo |
|date |2025-01-30 |
|pandoc |2.19.2 @ /opt/homebrew/bin/pandoc |

# Dependencies

|package |old |new |Δ |
|:---------|:------|:-----------|:--|
|torch |0.10.0 |0.10.0.9000 |* |
|bit |4.0.5 |4.0.5 | |
|bit64 |4.0.5 |4.0.5 | |
|callr |3.7.3 |3.7.3 | |
|cli |3.6.1 |3.6.1 | |
|coro |1.0.3 |1.0.3 | |
|desc |1.4.2 |1.4.2 | |
|ellipsis |0.3.2 |0.3.2 | |
|glue |1.6.2 |1.6.2 | |
|magrittr |2.0.3 |2.0.3 | |
|processx |3.8.1 |3.8.1 | |
|ps |1.7.5 |1.7.5 | |
|R6 |2.5.1 |2.5.1 | |
|Rcpp |1.0.10 |1.0.10 | |
|rlang |1.1.1 |1.1.1 | |
|rprojroot |2.0.3 |2.0.3 | |
|withr |2.5.0 |2.5.0 | |
|package |old |new |Δ |
|:------------|:-------|:-------|:--|
|torch |0.13.0 |0.14.0 |* |
|bit |4.5.0.1 |4.5.0.1 | |
|bit64 |4.6.0-1 |4.6.0-1 | |
|callr |3.7.6 |3.7.6 | |
|cli |3.6.3 |3.6.3 | |
|colorspace |NA |2.1-1 |* |
|coro |1.1.0 |1.1.0 | |
|desc |1.4.3 |1.4.3 | |
|ellipsis |0.3.2 |NA |* |
|farver |NA |2.1.2 |* |
|glue |1.8.0 |1.8.0 | |
|jsonlite |1.8.9 |1.8.9 | |
|labeling |NA |0.4.3 |* |
|lifecycle |NA |1.0.4 |* |
|magrittr |2.0.3 |2.0.3 | |
|munsell |NA |0.5.1 |* |
|processx |3.8.5 |3.8.5 | |
|ps |1.8.1 |1.8.1 | |
|R6 |2.5.1 |2.5.1 | |
|RColorBrewer |NA |1.1-3 |* |
|Rcpp |1.0.14 |1.0.14 | |
|rlang |1.1.5 |1.1.5 | |
|safetensors |0.1.2 |0.1.2 | |
|scales |NA |1.3.0 |* |
|viridisLite |NA |0.4.2 |* |
|withr |3.0.2 |3.0.2 | |

# Revdeps

## Failed to check (8)

|package |version |error |warning |note |
|:-------------|:-------|:-----------|:-------|:----|
|PLNmodels |1.0.1 |1 | | |
|proteus |1.1.0 |1 | | |
|scDHA |1.2.1 |1 | | |
|sits |1.4.0 |1 | | |
|SPQR |0.1.0 |1 | | |
|[targets](failures.md#targets)|1.1.3 |__+1__ | | |
|torchdatasets |0.3.0 |1 | | |
|[torchvision](failures.md#torchvision)|0.5.1 |1 -1 __+1__ | | |

## New problems (1)
## Failed to check (5)

|package |version |error |warning |note |
|:--------------|:-------|:------|:-------|:----|
|[torchvisionlib](problems.md#torchvisionlib)|0.4.0 |__+1__ | | |
|COTAN |2.6.2 |2 | |3 |
|proteus |1.1.4 |1 | | |
|tabnet |0.6.0 |2 | | |
|torchdatasets |0.3.1 |1 | | |
|[torchvisionlib](failures.md#torchvisionlib)|0.5.0 |__+1__ | | |

24 changes: 7 additions & 17 deletions revdep/cran.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
## revdepcheck results

We checked 25 reverse dependencies (24 from CRAN + 1 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package.
We checked 39 reverse dependencies (37 from CRAN + 2 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package.

* We saw 1 new problems
* We failed to check 8 packages
* We saw 0 new problems
* We failed to check 4 packages

Issues with CRAN packages are summarised below.

### New problems
(This reports the first line of each new failure)

* torchvisionlib
checking tests ...

### Failed to check

* PLNmodels (NA)
* proteus (NA)
* scDHA (NA)
* sits (NA)
* SPQR (NA)
* targets (NA)
* torchdatasets (NA)
* torchvision (NA)
* proteus (NA)
* tabnet (NA)
* torchdatasets (NA)
* torchvisionlib (NA)
Loading

0 comments on commit 3a53279

Please sign in to comment.