"...resnet50_tensorflow.git" did not exist on "a90ef19271200125f7151987a96fae5608511076"
Commit ce097b06 authored by laibao's avatar laibao
Browse files

chore: 将 lightop_dcu 包名统一为 lmcustomop

  - 删除旧构建脚本 setup_lightop_dcu.py
  - 新增 setup_lmcustomop.py,并同步更新包名/扩展模块名/版本环境变量
  - 更新 README 中安装、打包与导入示例为 lmcustomop
parent 98ac1648
# lightop_dcu # lmcustomop
## 简介 ## 简介
`lightop_dcu` 是一个面向 DCU/ROCm 环境的轻量融合算子包,当前聚焦于 **RMSNorm + RoPE 融合前向** `lmcustomop` 是一个面向 DCU/ROCm 环境的轻量融合算子包,当前聚焦于 **RMSNorm + RoPE 融合前向**
当前版本提供的核心能力: 当前版本提供的核心能力:
...@@ -27,19 +27,19 @@ ...@@ -27,19 +27,19 @@
在仓库目录执行: 在仓库目录执行:
```bash ```bash
python setup_lightop_dcu.py install python setup_lmcustomop.py install
``` ```
如果需要指定架构(示例): 如果需要指定架构(示例):
```bash ```bash
PYTORCH_ROCM_ARCH='gfx906;gfx926' python setup_lightop_dcu.py install PYTORCH_ROCM_ARCH='gfx906;gfx926' python setup_lmcustomop.py install
``` ```
### 构建 wheel ### 构建 wheel
```bash ```bash
python setup_lightop_dcu.py bdist_wheel python setup_lmcustomop.py bdist_wheel
``` ```
构建完成后,wheel 位于 `dist/` 目录。 构建完成后,wheel 位于 `dist/` 目录。
...@@ -57,7 +57,7 @@ python setup_lightop_dcu.py bdist_wheel ...@@ -57,7 +57,7 @@ python setup_lightop_dcu.py bdist_wheel
### Python 接口 ### Python 接口
```python ```python
from lightop_dcu import rms_rotary_embedding_fuse from lmcustomop import rms_rotary_embedding_fuse
query, key = rms_rotary_embedding_fuse( query, key = rms_rotary_embedding_fuse(
positions, positions,
...@@ -98,7 +98,7 @@ query, key = rms_rotary_embedding_fuse( ...@@ -98,7 +98,7 @@ query, key = rms_rotary_embedding_fuse(
## 安装验证 ## 安装验证
```bash ```bash
python -c "import lightop_dcu; print(lightop_dcu.rms_rotary_embedding_fuse)" python -c "import lmcustomop; print(lmcustomop.rms_rotary_embedding_fuse)"
``` ```
若能正常打印函数对象,说明安装成功。 若能正常打印函数对象,说明安装成功。
import os import os
from pathlib import Path from pathlib import Path
from setuptools import find_packages, setup from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension from torch.utils.cpp_extension import BuildExtension, CUDAExtension
...@@ -28,7 +28,7 @@ def get_extensions(): ...@@ -28,7 +28,7 @@ def get_extensions():
include_dirs = [str(ROOT_DIR / "csrc")] include_dirs = [str(ROOT_DIR / "csrc")]
extension = CUDAExtension( extension = CUDAExtension(
name="lightop_dcu.op", name="lmcustomop.op",
sources=sources, sources=sources,
include_dirs=include_dirs, include_dirs=include_dirs,
extra_compile_args=extra_compile_args, extra_compile_args=extra_compile_args,
...@@ -38,15 +38,13 @@ def get_extensions(): ...@@ -38,15 +38,13 @@ def get_extensions():
setup( setup(
name="lightop_dcu", name="lmcustomop",
version=os.getenv("LIGHTOP_DCU_VERSION", "0.0.1"), version=os.getenv("LMCUSTOMOP_VERSION", "0.0.1"),
description="Minimal lightop package", description="Minimal lmcustomop package",
packages=["lightop_dcu"], packages=["lmcustomop"],
package_dir={"lightop_dcu": "."}, package_dir={"lmcustomop": "."},
ext_modules=get_extensions(), ext_modules=get_extensions(),
cmdclass={"build_ext": BuildExtension}, cmdclass={"build_ext": BuildExtension},
zip_safe=False, zip_safe=False,
install_requires=["torch"], install_requires=["torch"],
) )
#/public/home/zhuww/laibao/pkg/rms_rope_laibao_260204/lightop_dcu/README.md
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment