Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PyTorch] cuBLAS workspace size fix for TP overlap unit test #1415

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

denera
Copy link
Collaborator

@denera denera commented Jan 17, 2025

Description

Ongoing work on PR #1337 exposed a bug in TP overlap where chunking/splitting a standard 32MiB cuBLAS workspace causes CUDA misaligned address error when cuBLAS dispatches an NVJET kernel for some (not all) GEMM sizes. Avoiding this misalignment requires the cuBLAS workspace allocation in the DL framework to be increased by a factor equal to the # of concurrent GEMM streams in TP overlap (i.e. 3 * 32MiB = 96 MiB for 3 concurrent streams).

Bootstrapping Userbuffers in transformer_engine.pytorch.base.initialize_ub() already accounts for this, but the pure GEMM unit test for TP overlap does not utilize this initialization. This PR corrects the workspace allocation in the pure GEMM unit test to avoid the misaligned address error in the CI.

Fixes #1332

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@denera denera added the bug Something isn't working label Jan 17, 2025
@denera denera self-assigned this Jan 17, 2025
Copy link
Member

@ksivaman ksivaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@denera
Copy link
Collaborator Author

denera commented Jan 17, 2025

/te-ci pytorch L1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants