Repository navigation
231 gpu training still faulty - #252
Conversation
|
@SebastianJiroSchlecht Kindly have a look at the fix |
|
Review of 38cd49a (pass Diagnosis. FLAMO's This commit avoids the mismatch in one example and in FLAMO's Suggested fix
Also: #231 is "GPU training doesn't run on molab", and CI is CPU-only — please run the training example on a molab GPU before we merge. |
|
Follow-up: switching to Fix upstream: gdalsanto/flamo#38 stores every module's device the way a tensor reports it. With that branch, pyFDN's full suite passes with the string |
FLAMO 0.2.20 stores every module's device the way a tensor reports it (gdalsanto/flamo#38), so device="cpu" strings and .to() mix again and torch.device("cuda") no longer mismatches cuda:0. Revert 38cd49a: the allpass example is back on plain "cpu" strings and now doubles as the regression test in test_marimo_examples_run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Pushed a commit: FLAMO 0.2.20 includes the device fix (gdalsanto/flamo#38), so this PR now requires Still open before merging: a run of the training example on a molab GPU (#231). The optional |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6VyZo1pfcFKwK1Nz6cWcC
- train_fdn defaults to the model's device instead of "cpu", so a model built on CUDA is no longer moved back to the CPU for training. - wrap_fdn_shell defaults to the core's own device, so wrapping a CPU core on a GPU machine no longer fails in Shell's device check. - Restore model.set_nfft(train_nfft / render_nfft) in the training example, removed in 567bb30; the example trains and renders on different FFT grids again. - Fix the indentation of the device="cpu" lines in the multislope example. - Tests: Shell assembled from a device="cpu" core and .to("cpu") layers (fails on flamo 0.2.19, passes on 0.2.20); build, render and train with default arguments stay on the model's device, and wrap_fdn_shell keeps the core's device, on CPU and on CUDA/MPS when available. - HISTORY entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6VyZo1pfcFKwK1Nz6cWcC
|
Pushed afafdbc (merge of
The full suite passes locally on FLAMO 0.2.20, which is the current PyPI release: 523 passed, 1 skipped. Still open: a run of the training example on a molab GPU (#231). CI and my environment are CPU-only, so the CUDA test above has not run yet. It will run on a GPU with Generated by Claude Code |
Resolve conflicts with #255: keep both HISTORY entries, require flamo>=0.2.20 and drop flareverb, take the (delays, A, B, C, D) argument order in dss_to_flamo and the new tests, pass device through main's wrap_fdn_shell call, accept the removal of auxiliary/coupled_rooms.py, and use main's default_device in wrap_fdn_shell. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6VyZo1pfcFKwK1Nz6cWcC
|
@SebastianJiroSchlecht
I repeated this 2 times Please tell me if I am missing something |
Summary
Fix GPU training (#231). The device mismatch ("input layer has device = cpu and the core has device = cpu") came from FLAMO comparing the string
"cpu"with thetorch.devicethat.to()stores; FLAMO 0.2.20 (gdalsanto/flamo#38) canonicalizes module devices, so this PR requiresflamo>=0.2.20. On the pyFDN side:model_responseexcites the model on the model's own device.wrap_fdn_shell/dss_to_flamo/trainable_from_buildbuild the FFT layers on the requested device;wrap_fdn_shelldefaults to the core's own device.train_fdndefaults to the model's device instead of"cpu", so a CUDA model is not moved back to the CPU for training.device="cpu"explicitly where they build FLAMO modules by hand.Fixes #231
Testing
pytestpasses locally (523 passed, 1 skipped on FLAMO 0.2.20; CPU only)Shellfrom adevice="cpu"core plus.to("cpu")layers (fails on 0.2.19); build/render/train andwrap_fdn_shellstay on the model's device, on CPU and on CUDA/MPS when available (skipped without a GPU)pytest --cov=pyFDN)Checklist
pre-commit run --all-files)HISTORY.rstupdated if this is a user-facing change