mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[PR #768] test: add GPU-free unit tests for host-side utility modules #770
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/DeepEP#770
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/DeepEP/pull/768
Author: @Dashener2
Created: 9/29/2026
Status: 🔄 Open
Base:
main← Head:test/host-utils-gpu-free📝 Commits (1)
4bee4d5test: add GPU-free unit tests for host-side utility modules📊 Changes
4 files changed (+219 additions, -1 deletions)
View changed files
📝
deep_ep/utils/math.py(+7 -1)➕
tests/utils/test_math.py(+101 -0)➕
tests/utils/test_semantic.py(+66 -0)➕
tests/utils/test_testing.py(+45 -0)📄 Description
Problem
Importing
deep_eprunscheck_nccl_so()andinit_jit(), which require the compiledextension and a NCCL install, so the pure-Python helpers under
deep_ep/utils/could notbe tested on a machine without a GPU. While adding those tests,
hash_tensor()turned outto raise for common inputs.
Root cause
deep_ep/utils/math.py:view(torch.int)requires a contiguous tensor with a 4-byte element size. It raises forbool,int64,float16/bfloat16, and for non-contiguous tensors.hash_tensorsis apublic helper under
deep_ep.utils.math, so any caller hashing non-float32 test data hitsthis.
Fix
Load the host modules directly by path so the tests do not import
deep_ep, and makehash_tensordtype/layout agnostic:Testing
No GPU, no CUDA and no compiled extension required:
Verified with
torch 2.8.0+cpuandnumpy 1.26. The added hash test fails against the oldimplementation with
RuntimeError: self.stride(-1) must be 1 to view Long as Int.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.