mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[PR #21] [CLOSED] pytest Integration #207
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepGEMM#207
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/DeepGEMM/pull/21
Author: @A-transformer
Created: 2/27/2025
Status: ❌ Closed
Base:
main← Head:A-transformer-patch-2📝 Commits (3)
58046b4pytest Integrationf9a6da9pytest Integration5479ffepytest Integration📊 Changes
3 files changed (+149 additions, -117 deletions)
View changed files
📝
README.md(+3 -2)📝
tests/test_core.py(+99 -102)📝
tests/test_jit.py(+47 -13)📄 Description
Decorate the test function with @pytest.mark.skipif(...) so the test is skipped if CUDA is unavailable. Move all testing logic into a function named test_jit() so it’s automatically discoverable by pytest.
CUTLASS Configuration
Ensure that the CUTLASS_ROOT environment variable is set. For example:
export CUTLASS_ROOT=/root/DeepGEMM/third-party/cutlass
export CPATH="$CUTLASS_ROOT/include:$CPATH"
export CPLUS_INCLUDE_PATH="$CUTLASS_ROOT/include:$CPLUS_INCLUDE_PATH"
Running the Tests:
pip install pytest
pytest tests/test_jit.py -v -s
===================================================================================== test session starts =====================================================================================
platform linux -- Python 3.11.11, pytest-8.3.4, pluggy-1.5.0 -- /root/miniconda3/envs/gemm/bin/python
cachedir: .pytest_cache
rootdir: /root/autodl-tmp/DeepGEMM
collected 1 item
tests/test_jit.py::test_jit NVCC compiler: ('/usr/local/cuda/bin/nvcc', '12.4')
Generated code:
// DeepGEMM auto-generated JIT CUDA source file
#include <cuda.h>
#include <cuda_fp8.h>
#include <cuda_runtime.h>
#include
#include "cutlass/cutlass.h"
extern "C" void launch(void* __raw_lhs, void* __raw_rhs, void* __raw_scale, void* __raw_out, bool enable_double_streams, void* __raw_stream, int& __return_code) {
// Cast raw types (if needed)
auto lhs = reinterpret_cast<__nv_fp8_e4m3*>(__raw_lhs);
auto rhs = reinterpret_cast<__nv_fp8_e4m3*>(__raw_rhs);
auto scale = reinterpret_cast<float*>(__raw_scale);
auto out = reinterpret_cast<__nv_bfloat16*>(__raw_out);
auto stream = reinterpret_cast<cudaStream_t>(__raw_stream);
std::cout << reinterpret_cast<uint64_t>(lhs) << std::endl;
std::cout << reinterpret_cast<uint64_t>(rhs) << std::endl;
std::cout << reinterpret_cast<uint64_t>(scale) << std::endl;
std::cout << reinterpret_cast<uint64_t>(out) << std::endl;
std::cout << enable_double_streams << std::endl;
std::cout << reinterpret_cast<uint64_t>(stream) << std::endl;
}
Building ...
Running ...
JIT test passed
PASSED
====================================================================================== 1 passed in 6.18s ======================================================================================
Test environment on H800 ,cuda 12.7 , Python 3.11.11, pytest-8.3.4, pluggy-1.5.0
Thu Feb 27 14:13:11 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 565.57.01 Driver Version: 565.57.01 CUDA Version: 12.7 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA H800 PCIe On | 00000000:39:00.0 Off | Off |
| N/A 31C P0 49W / 350W | 1MiB / 81559MiB | 0% Default |
| | | Disabled |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| No running processes found |
+-----------------------------------------------------------------------------------------+
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.