{"id":19001264,"url":"https://github.com/oneflow-inc/oneflow-hip","last_synced_at":"2025-10-05T09:56:36.899Z","repository":{"id":163801517,"uuid":"623276719","full_name":"Oneflow-Inc/oneflow-hip","owner":"Oneflow-Inc","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-15T03:56:08.000Z","size":66627,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"rocm","last_synced_at":"2025-10-05T09:56:35.538Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Oneflow-Inc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-04T03:40:33.000Z","updated_at":"2024-08-19T12:53:46.000Z","dependencies_parsed_at":"2024-11-08T18:10:42.417Z","dependency_job_id":"4cbb15e6-4866-499c-97ee-191c1a4e065a","html_url":"https://github.com/Oneflow-Inc/oneflow-hip","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Oneflow-Inc/oneflow-hip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oneflow-Inc%2Foneflow-hip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oneflow-Inc%2Foneflow-hip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oneflow-Inc%2Foneflow-hip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oneflow-Inc%2Foneflow-hip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Oneflow-Inc","download_url":"https://codeload.github.com/Oneflow-Inc/oneflow-hip/tar.gz/refs/heads/rocm","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oneflow-Inc%2Foneflow-hip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278437950,"owners_count":25986760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T18:10:32.412Z","updated_at":"2025-10-05T09:56:36.883Z","avatar_url":"https://github.com/Oneflow-Inc.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OneFlow\n\nOneFlow 是一个深度学习框架，旨在**易用，可扩展且高效**。使用 OneFlow，很容易做到:\n\n- 模型编程使用与 pytorch 类似的 API\n\n- 使用 global API 将模型扩展到 n 维并行以便于分布式执行\n- 使用静态图编译器加速/部署模型\n\n## Latest News\n\n- Version 1.0.0 is out!\n  - [Full changelog](https://github.com/Oneflow-Inc/oneflow/releases/tag/v1.0.0)\n\n## 安装 OneFlow-DCU\n\n### System Requirements\n\n- Linux.\n\n- Python 3.7, 3.8, 3.9\n\n- (**推荐**) Upgrade pip\n\n  ```\n  python3 -m pip install --upgrade pip #--user\n  ```\n\n###  Pip 安装\n\n可以再光合[光合开发者社区](https://developer.hpccube.com/tool/#sdk) AI 生态包中获取最新的 Oneflow-DCU Release 版本（需对应 DCU Toolkit 版本与 python 版本）\n\n```bash\npython3 -m pip install oneflow-0.9+dtk22101.git.5be579-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n```\n\n### 使用镜像\n\n  ```bash\n  python3 -m pip install --pre oneflow -f https://oneflow-staging.oss-cn-beijing.aliyuncs.com/branch/master/cu118\n  ```\n\n- To install other available builds for different variants:\n\n  - Stable\n    ```bash\n    python3 -m pip install --find-links https://release.oneflow.info oneflow==0.9.0+cu118\n    ```\n  - Nightly\n    ```\n    python3 -m pip install --pre oneflow -f https://staging.oneflow.info/branch/master/[PLATFORM]\n    ```\n  - All available `[PLATFORM]`:\n    | Platform |CUDA Driver Version| Supported GPUs |\n    |---|---|---|\n    | cu118 | \u003e= 450.80.02 | GTX 10xx, RTX 20xx, A100, RTX 30xx |\n    | cpu | N/A | N/A |\n\n- If you are in China, you could run this to have pip download packages from domestic mirror of pypi:\n  ```\n  python3 -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple\n  ```\n  For more information on this, please refer to [pypi 镜像使用帮助](https://mirror.tuna.tsinghua.edu.cn/help/pypi/)\n\n### Use docker image\n\n```\ndocker pull image.sourcefind.cn:5000/dcu/admin/base/oneflow:0.9.1-centos7.6-dtk-22.10.1-py39-latest\n```\n\n### 在 DCU 平台上源码编译（DTK-22.10.1，Python3.9）\n\n- 拉取官方 CPU 镜像\n\n  ```\n  docker pull oneflowinc/manylinux2014_x86_64_cpu:latest\n  ```\n\n- 使用官网镜像建立 docker\n\n  ```\n  docker run -it --network=host --name=oneflow_compile --privileged --device=/dev/kfd --device=/dev/dri --ipc=host --shm-size=16G  --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -u root --ulimit stack=-1:-1 --ulimit memlock=-1:-1 -v /public/home/xxx:/home oneflowinc/manylinux2014_x86_64_cpu:latest /bin/bash\n  \n  docker exec -it oneflow_compile /bin/bash\n  ```\n\n- 拉取 oneflow 代码\n\n  ```\n  git clone -b 0.9.1-rocm http://developer.hpccube.com/codes/aicomponent/oneflow.git\n  ```\n\n- 在[开发者社区](https://developer.hpccube.com/tool/#sdk) DCU Toolkit 中下载 DTK-22.10.1 解压至 /opt/ 路径下，并建立软链接\n\n  ```\n  cd /opt \u0026\u0026 ln -s dtk-22.10.1 rocm\n  ```\n\n- 导入环境变量以及安装必要依赖库\n\n  ```\n  export ROCM_PATH=/opt/rocm\n  export HIP_PATH=${ROCM_PATH}/hip\n  export CPACK_INSTLL_PREFIX=$ROCM_PATH\n  export AMDGPU_TARGETS=\"gfx900;gfx906\"\n  export PATH=${ROCM_PATH}/bin:${ROCM_PATH}/llvm/bin:${ROCM_PATH}/hcc/bin:${ROCM_PATH}/hip/bin:$PATH\n  export LD_LIBRARY_PATH=${ROCM_PATH}/lib:${ROCM_PATH}/lib64:$LD_LIBRARY_PATH\n  export LD_LIBRARY_PATH=${ROCM_PATH}/hip/lib:${ROCM_PATH}/llvm/lib:${ROCM_PATH}/opencl/lib/x86_64:$LD_LIBRARY_PATH\n  export C_INCLUDE_PATH=${ROCM_PATH}/include:${ROCM_PATH}/hip/include/hip:${ROCM_PATH}/llvm/include:/opencl/include:${C_INCLUDE_PATH}\n  export CPLUS_INCLUDE_PATH=${ROCM_PATH}/include:${ROCM_PATH}/hip/include/hip:${ROCM_PATH}/llvm/include:/opencl/include:${CPLUS_INCLUDE_PATH}\n  export PATH=${ROCM_PATH}/miopen/bin:${ROCM_PATH}/rocblas/bin:${ROCM_PATH}/hipsparse/bin:$PATH\n  export LD_LIBRARY_PATH=${ROCM_PATH}/miopen/lib:${ROCM_PATH}/rocblas/lib:$LD_LIBRARY_PATH\n  export MIOPEN_SYSTEM_DB_PATH=${ROCM_PATH}/miopen/share/miopen/db/\n  export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH\n  export LIBRARY_PATH=/usr/lib64:$LIBRARY_PATH                     \n  export RCCL_PATH=$ROCM_PATH/rccl\n  export NCCL_PATH=$ROCM_PATH/rccl\n  export LD_LIBRARY_PATH=$RCCL_PATH/lib:$LD_LIBRARY_PATH\n  \n  export MIOPEN_FIND_MODE=3\n  export HSA_FORCE_FINE_GRAIN_PCIE=1\n  export MIOPEN_COMPILE_PARALLEL_LEVEL=1\n  \n  source /opt/rh/devtoolset-7/enable\n  \n  export PV=39\n  ln -s /opt/python/cp${PV}-cp${PV}/bin/python3 /usr/bin/python3\n  ln -s /opt/python/cp${PV}-cp${PV}/bin/pip3 /usr/bin/pip3\n  \n  yum install -y numactl libffi* openblas openblas-devel libibverbs-devel\n  cd oneflow \u0026\u0026 pip3 install -r dev-requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com\n  ```\n\n- cmake \u0026\u0026 make\n\n  ```\n  cd oneflow \u0026\u0026 mkdir build \u0026\u0026 cmake .. -DBUILD_CUDA=OFF -DBUILD_ROCM=ON -DONEFLOW=ON -DUSE_CLANG_FORMAT=OFF -DCMAKE_BUILD_TYPE=Release -DTHIRD_PARTY=ON -DTREAT_WARNINGS_AS_ERRORS=OFF -DTHIRD_PARTY_MIRROR=aliyun -DBUILD_HWLOC=OFF -DCMAKE_C_COMPILER=${ROCM_PATH}/llvm/bin/clang -DCMAKE_CXX_COMPILER=${ROCM_PATH}/llvm/bin/clang++ -DBUILD_TESTING=ON -DBUILD_RDMA=ON -DBUILD_PROFILER=ON\n  \n  make -j32\n  ```\n\n- 验证安装\n\n  ```\n  cd build \u0026\u0026 source source.sh    # 将oneflow导入PYTHONPATH\n  python3 -c “import oneflow”\n  ```\n\n### Advanced features\n\n- [OneFlow-XRT](https://github.com/Oneflow-Inc/oneflow-xrt): An extension for OneFlow to target third-party compiler, such as XLA, TensorRT and OpenVINO etc.\n\n## Getting Started\n\n- Please refer to [QUICKSTART](https://docs.oneflow.org/en/master/basics/01_quickstart.html)\n- 中文版请参见 [快速上手](https://docs.oneflow.org/master/basics/01_quickstart.html)\n\n## Documentation\n\n- [API Reference](https://oneflow.readthedocs.io/en/master/)\n- [Usage \u0026 Design Docs](http://docs.oneflow.org/)\n- [System Design](https://docs.oneflow.org/en/v0.4.0/basics_topics/essentials_of_oneflow.html)\n\n## Model Zoo and Benchmark\n\n- [Libai(Toolbox for Parallel Training Large-Scale Transformer Models)](https://github.com/Oneflow-Inc/libai)\n  \n  - [BERT-large](https://libai.readthedocs.io/en/latest/tutorials/get_started/quick_run.html)\n  \n  - [GPT](https://libai.readthedocs.io/en/latest/modules/libai.models.html#id5)\n  \n    使用LiBai的GPT2，DCU与A800的精度对比曲线如下：\n  \n    ![](https://github.com/yuguo-Jack/oneflow-hip/blob/rocm/gpt2_loss.jpg)\n  \n  - [T5](https://libai.readthedocs.io/en/latest/modules/libai.models.html#id4)\n  \n  - [VisionTransformer](https://libai.readthedocs.io/en/latest/modules/libai.models.html#id1)\n  \n  - [SwinTransformer](https://libai.readthedocs.io/en/latest/modules/libai.models.html#id2)\n  \n- [FlowVision(Toolbox for Computer Vision Datasets, SOTA Models and Utils)](https://github.com/Oneflow-Inc/vision)\n\n- [OneFlow-Models(Examples of How to Implement Models in Various Fields with OneFlow)](https://github.com/Oneflow-Inc/models)\n  - [ResNet-50](https://github.com/Oneflow-Inc/models/tree/main/Vision/classification/image/resnet50)\n  - [Wide\u0026Deep](https://github.com/Oneflow-Inc/models/tree/main/RecommenderSystems/wide_and_deep)\n  \n- [OneFlow-Benchmark(Outdated)](https://github.com/Oneflow-Inc/OneFlow-Benchmark)\n\n## Communication\n\n- [GitHub issues](https://github.com/Oneflow-Inc/oneflow/issues): any install, bug, feature issues.\n- [www.oneflow.org](http://www.oneflow.org): brand related information.\n\n- ### 中文\n\n  - QQ 群: 331883\n  - 微信号（加好友入交流群）: OneFlowXZS\n  - [知乎](https://www.zhihu.com/org/oneflow-17)\n\n- ### International\n  - [Discord](https://discord.gg/4kpjGA5bZY)\n  - [Twitter](https://twitter.com/OneFlowNews)\n  - [LinkedIn](https://www.linkedin.com/company/oneflow-inc)\n  - [Medium](https://oneflow2020.medium.com)\n\n## The Team\n\nOneFlow was originally developed by [OneFlow Inc](http://www.oneflow.org) and [Zhejiang Lab](http://www.zhejianglab.com/).\n\n## License\n\n[Apache License 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foneflow-inc%2Foneflow-hip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foneflow-inc%2Foneflow-hip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foneflow-inc%2Foneflow-hip/lists"}