Skip to content

matmul dtensor experiments#2260

Open
ClaudiaComito wants to merge 7 commits into
mainfrom
features/matmul-dtensor-experiments
Open

matmul dtensor experiments#2260
ClaudiaComito wants to merge 7 commits into
mainfrom
features/matmul-dtensor-experiments

Conversation

@ClaudiaComito

@ClaudiaComito ClaudiaComito commented Apr 22, 2026

Copy link
Copy Markdown
Member

Due Diligence

  • General:
  • Implementation:
    • unit tests: all split configurations tested
    • unit tests: multiple dtypes tested
    • NEW unit tests: MPS tested (1 MPI process, 1 GPU)
    • benchmarks: created for new functionality
    • benchmarks: performance improved or maintained
    • documentation updated where needed

Description

Eventually we would like to implement NCCL or torch.distributed as alternative communication backends for optimized communication on multi-GPU.

A relatively straightforward way for selected operations would be to pipe relevant DNDarray operands into torch DTensors. Here's an example that works for matrix multiplication.

Note that torch.distr doesn't implement the -v and -w collective calls (Allgatherv, Alltoallv....) and therefore only supports same-size slices/chunks on each process. The DTensor backend is only available for equally distributed arrays on GPU.

More on tests and benchmarks in the comments.

Issue/s resolved: #

Changes proposed:

  • add mesh initialization in communication.py
  • add helper functions in linalg/basics.py (for now) to go from DNDarray to DTensor and vice versa - these should probably move to factories or the dndarray module or even a dedicated module
  • ht.matmul is taking off to DTensor.matmul if the DNDarrays are on GPU and distributed equally.

Type of change

Memory requirements

Performance

Does this change modify the behaviour of other functions? If so, which?

yes / no

@github-project-automation github-project-automation Bot moved this to Todo in Roadmap Apr 22, 2026
@ClaudiaComito
ClaudiaComito marked this pull request as draft April 22, 2026 10:06
@ClaudiaComito
ClaudiaComito marked this pull request as ready for review April 22, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants