Skip to content

Commit

Permalink
small bugfixes and add tmux ssh session for interactive debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
nkoenen committed Nov 25, 2024
1 parent 65b08f7 commit bf0d3a9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ jobs:
TORCH_TEST: 1
TORCH_INSTALL: 1
TORCH_COMMIT_SHA: "none"
OMP_NUM_THREADS: 1
MKL_NUM_THREADS: 1
PYTORCH_ENABLE_MPS_FALLBACK: 1
PYTORCH_MPS_HIGH_WATERMARK_RATIO: 0.0

steps:
- uses: actions/checkout@v3
Expand All @@ -65,13 +66,24 @@ jobs:
run: keras::install_keras()
shell: Rscript {0}

# Get a tmux ssh session for interactive debugging
# Controlled via inputs from GitHub webinterface
# See https://github.com/mxschmitt/action-tmate
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}

- name: Check if torch is installed
run: |
library(torch)
if (!torch_is_installed()) {
print("Torch is not installed!")
install_torch()
}
if (torch::backends_mps_is_available()) {
print("LibTorch is built with MPS support!")
}
print(paste0("Default number of threads: ", torch_get_num_threads()))
print(torch_randn(1))
shell: Rscript {0}

Expand Down

0 comments on commit bf0d3a9

Please sign in to comment.