René's URL Explorer Experiment


Title: Low GEMM Performance on Hopper GPU with Small M Shapes · Issue #21 · NVIDIA/nvmath-python · GitHub

Open Graph Title: Low GEMM Performance on Hopper GPU with Small M Shapes · Issue #21 · NVIDIA/nvmath-python

X Title: Low GEMM Performance on Hopper GPU with Small M Shapes · Issue #21 · NVIDIA/nvmath-python

Description: Hi, Thank you for the great library! I’m observing some unexpected performance with GEMM on Hopper GPUs when using small M dimensions. I followed the example in example14_autotune.py. Compared to the PyTorch implementation, the performan...

Open Graph Description: Hi, Thank you for the great library! I’m observing some unexpected performance with GEMM on Hopper GPUs when using small M dimensions. I followed the example in example14_autotune.py. Compared to t...

X Description: Hi, Thank you for the great library! I’m observing some unexpected performance with GEMM on Hopper GPUs when using small M dimensions. I followed the example in example14_autotune.py. Compared to t...

Opengraph URL: https://github.com/NVIDIA/nvmath-python/issues/21

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Low GEMM Performance on Hopper GPU with Small M Shapes","articleBody":"Hi,\n\nThank you for the great library! I’m observing some unexpected performance with GEMM on Hopper GPUs when using small M dimensions. I followed the example in [example14_autotune.py](https://github.com/NVIDIA/nvmath-python/blob/main/examples/linalg/advanced/matmul/example14_autotune.py).\n\nCompared to the PyTorch implementation, the performance is significantly lower — around 30% of the expected TFLOPS and memory bandwidth utilization.\n\n\u003cimg width=\"565\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/d5a87505-8f0b-4426-a522-a2dac97c9b96\" /\u003e\n\nNot sure I am correctly using the API — I would greatly appreciate any suggestions.\n\nEnvironment:\n\t•\tGPU: H200\n\t•\tCUDA: 12.8\n\t•\tPyTorch: 2.6.0\n\t•\tnvmath-python: 0.3.0\n\nBenchmark code:\n\n```python\nimport argparse\n\nimport torch\nimport nvmath\nfrom triton.testing import do_bench\n\n\ndef profile(m, n, k, dtype):\n    device = torch.device(\"cuda\")\n    assert isinstance(device, torch.device)\n\n    X = torch.randn(m, k, device=device, dtype=dtype)\n    Y = torch.randn(n, k, device=device, dtype=dtype)\n    \n    _torch_gemm = lambda: torch.matmul(X, Y)\n    \n    mm = nvmath.linalg.advanced.Matmul(X, Y)\n    \n    mm.plan(preferences={\"limit\":1000})\n    mm.autotune(iterations=1000)\n    \n    # print(mm.algorithms[0].capabilities)\n    _nvmath_gemm = lambda: mm.execute()\n    \n    t_torch = do_bench(_torch_gemm)\n    t_nvmath = do_bench(_nvmath_gemm)\n    \n    return t_torch, t_nvmath\n\n\nif __name__ == \"__main__\":\n    parser = argparse.ArgumentParser(description=\"GEMM profile\")\n    parser.add_argument(\"--m\", type=int, default=4096)\n    parser.add_argument(\"--n\", type=int, default=4096)\n    parser.add_argument(\"--k\", type=int, default=4096)\n    args = parser.parse_args()\n\n    print(\"Provider,Operation,dtype,m,n,k,Runtime,GB/s,GFLOPs\")\n    \n    for dtype in [torch.float16, torch.bfloat16]:\n        t_torch, t_nvmath = profile(args.m, args.n, args.k, dtype)\n\n        m = args.m\n        n = args.n\n        k = args.k\n\n        torch_mem_bd = 2 * (m * n + n * k + m * k) * 1e3 / t_torch / 1e9\n        torch_gflops = 2 * m * n * k * 1e3 / t_torch / 1e9\n        nv_mem_bd = 2 * (m * n + n * k + m * k) * 1e3 / t_nvmath / 1e9\n        nv_gflops = 2 * m * n * k * 1e3 / t_nvmath / 1e9\n        \n        print(f\"TORCH,0,{dtype},{args.m},{args.n},{args.k},{t_torch},{torch_mem_bd},{torch_gflops}\")\n        print(f\"NVMATH,0,{dtype},{args.m},{args.n},{args.k},{t_nvmath},{nv_mem_bd},{nv_gflops}\")\n```\n","author":{"url":"https://github.com/happierpig","@type":"Person","name":"happierpig"},"datePublished":"2025-03-28T00:22:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/21/nvmath-python/issues/21"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ff5693f9-b21e-307d-3a5e-afdb1e7eee54
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC2F6:3E8D3B:210B4F4:2FE68EA:6A60AEC9
html-safe-nonce18eff4f771c7308c9870084bdc23bf767da09f8345823e77a7af52735f1e5716
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkY2OjNFOEQzQjoyMTBCNEY0OjJGRTY4RUE6NkE2MEFFQzkiLCJ2aXNpdG9yX2lkIjoiNDc2NTI2MjQ0NTcxNTQzNTIwOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac24712d5aeeec8d97a2c8aa237d451254da01f54b80eba9194eb15064483e57ed
hovercard-subject-tagissue:2954716062
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NVIDIA/nvmath-python/21/issue_layout
twitter:imagehttps://opengraph.githubassets.com/5e592047a5a7b903fa25c286a09a049018598e1033d6d9b2fddcbd126fb9caa8/NVIDIA/nvmath-python/issues/21
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/5e592047a5a7b903fa25c286a09a049018598e1033d6d9b2fddcbd126fb9caa8/NVIDIA/nvmath-python/issues/21
og:image:altHi, Thank you for the great library! I’m observing some unexpected performance with GEMM on Hopper GPUs when using small M dimensions. I followed the example in example14_autotune.py. Compared to t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamehappierpig
hostnamegithub.com
expected-hostnamegithub.com
None66af895cfa11168648b21cb54f2bdc3b0587503cc95c3040344b93f2cd4f9e08
turbo-cache-controlno-preview
go-importgithub.com/NVIDIA/nvmath-python git https://github.com/NVIDIA/nvmath-python.git
octolytics-dimension-user_id1728152
octolytics-dimension-user_loginNVIDIA
octolytics-dimension-repository_id788208729
octolytics-dimension-repository_nwoNVIDIA/nvmath-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id788208729
octolytics-dimension-repository_network_root_nwoNVIDIA/nvmath-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb2efb079bef4751afb19e51eb8a7bfb7a46dd1a0
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NVIDIA/nvmath-python/issues/21#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNVIDIA%2Fnvmath-python%2Fissues%2F21
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNVIDIA%2Fnvmath-python%2Fissues%2F21
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=NVIDIA%2Fnvmath-python
Reloadhttps://github.com/NVIDIA/nvmath-python/issues/21
Reloadhttps://github.com/NVIDIA/nvmath-python/issues/21
Reloadhttps://github.com/NVIDIA/nvmath-python/issues/21
Please reload this pagehttps://github.com/NVIDIA/nvmath-python/issues/21
NVIDIA https://github.com/NVIDIA
nvmath-pythonhttps://github.com/NVIDIA/nvmath-python
Notifications https://github.com/login?return_to=%2FNVIDIA%2Fnvmath-python
Fork 41 https://github.com/login?return_to=%2FNVIDIA%2Fnvmath-python
Star 588 https://github.com/login?return_to=%2FNVIDIA%2Fnvmath-python
Code https://github.com/NVIDIA/nvmath-python
Issues 8 https://github.com/NVIDIA/nvmath-python/issues
Pull requests 0 https://github.com/NVIDIA/nvmath-python/pulls
Discussions https://github.com/NVIDIA/nvmath-python/discussions
Actions https://github.com/NVIDIA/nvmath-python/actions
Security and quality 0 https://github.com/NVIDIA/nvmath-python/security
Insights https://github.com/NVIDIA/nvmath-python/pulse
Code https://github.com/NVIDIA/nvmath-python
Issues https://github.com/NVIDIA/nvmath-python/issues
Pull requests https://github.com/NVIDIA/nvmath-python/pulls
Discussions https://github.com/NVIDIA/nvmath-python/discussions
Actions https://github.com/NVIDIA/nvmath-python/actions
Security and quality https://github.com/NVIDIA/nvmath-python/security
Insights https://github.com/NVIDIA/nvmath-python/pulse
Low GEMM Performance on Hopper GPU with Small M Shapeshttps://github.com/NVIDIA/nvmath-python/issues/21#top
https://github.com/happierpig
happierpighttps://github.com/happierpig
on Mar 28, 2025https://github.com/NVIDIA/nvmath-python/issues/21#issue-2954716062
example14_autotune.pyhttps://github.com/NVIDIA/nvmath-python/blob/main/examples/linalg/advanced/matmul/example14_autotune.py
https://private-user-images.githubusercontent.com/74357408/427793009-d5a87505-8f0b-4426-a522-a2dac97c9b96.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODQ3MjEzOTcsIm5iZiI6MTc4NDcyMTA5NywicGF0aCI6Ii83NDM1NzQwOC80Mjc3OTMwMDktZDVhODc1MDUtOGYwYi00NDI2LWE1MjItYTJkYWM5N2M5Yjk2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA3MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNzIyVDExNTEzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYyNDE5ZjkwYmZiZjE3NGQ0YWQ2ZTkyYWM0NGFiMWNkNThkODM5ZDFjZTQ2MmVmZjlkNzYxYjEwMjM5ODJmMGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.j2sd0Tu_X71EGzZma6Uw_ucIrb8fmeDEcD3j9BT93f8
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.