Skip to content

compiler: Add PyTorch tensor storage and code generation - #3107

Open
mloubout wants to merge 1 commit into
mainfrom
feature/torch-backend
Open

mloubout wants to merge 1 commit into
mainfrom
feature/torch-backend

Conversation

@mloubout

@mloubout mloubout commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

WIP, to get opinions.

@mloubout mloubout added the API api (symbolics, types, ...) label Nov 7, 2026
@codecov

codecov Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.94656% with 171 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.59%. Comparing base (00e78a5) to head (f1d5df9).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tests/test_data_backends.py 74.11% 44 Missing ⚠️
tests/test_torch_openacc.py 76.74% 39 Missing and 1 partial ⚠️
devito/data/data.py 86.03% 29 Missing and 8 partials ⚠️
devito/types/dense.py 78.78% 5 Missing and 2 partials ⚠️
devito/arch/compiler.py 83.78% 4 Missing and 2 partials ⚠️
devito/data/allocators.py 85.00% 5 Missing and 1 partial ⚠️
devito/data/distributed/exchange.py 0.00% 6 Missing ⚠️
devito/tools/dtypes_lowering.py 60.00% 5 Missing and 1 partial ⚠️
examples/pytorch/devito_layer.py 93.82% 4 Missing and 1 partial ⚠️
devito/data/distributed/redistribution.py 0.00% 4 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3107      +/-   ##
==========================================
+ Coverage   84.46%   84.59%   +0.12%     
==========================================
  Files         260      269       +9     
  Lines       58758    59955    +1197     
  Branches     4988     5073      +85     
==========================================
+ Hits        49632    50716    +1084     
- Misses       8299     8397      +98     
- Partials      827      842      +15     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 68.20% <50.38%> (-0.20%) ⬇️
pytest-gpu-gcc- 79.36% <81.14%> (+0.17%) ⬆️
pytest-gpu-icx- 79.30% <81.29%> (+0.16%) ⬆️
pytest-gpu-nvc-nvidiaX 69.29% <64.94%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mloubout
mloubout force-pushed the feature/torch-backend branch from 4b64456 to e624fc4 Compare November 8, 2026 14:05
Add TorchAllocator and tensor-backed Data using Devito's shared indexing,
halo exchange, and MPI abstractions. Preserve tensor ownership and expose
tensor data through the ordinary Function and TimeFunction APIs.

Add a Torch language and C++ printer that retain optimized Devito loops,
and support CUDA tensor pointers in generated OpenACC kernels. Keep compiler
requirements local to operators and resolve the appropriate OpenMP/OpenACC
runtime for the selected toolchain.

Include allocator, indexing, MPI, code-generation, OpenACC, and differentiable
network-layer tests in the existing CPU and GPU workflows, with a CPU layer
example and backend documentation.
@mloubout
mloubout force-pushed the feature/torch-backend branch from e624fc4 to f1d5df9 Compare November 9, 2026 12:18
@mloubout
mloubout marked this pull request as ready for review November 9, 2026 15:06

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API api (symbolics, types, ...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant