Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MLU #121

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

MLU #121

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion src/buildOneFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const CUDA_112_IMG_TAG = `registry.cn-beijing.aliyuncs.com/oneflow/manylinux2014
const CUDA_110_IMG_TAG = `registry.cn-beijing.aliyuncs.com/oneflow/manylinux2014_x86_64_cuda11.0:${ProductionCommit}`
const CUDA_102_IMG_TAG = `registry.cn-beijing.aliyuncs.com/oneflow/manylinux2014_x86_64_cuda10.2:${ProductionCommit}`
const CUDA_CPU_IMG_TAG = `registry.cn-beijing.aliyuncs.com/oneflow/manylinux2014_x86_64_cpu:${ProductionCommit}`
const CUDA_MLU_IMG_TAG = `registry.cn-beijing.aliyuncs.com/oneflow/cambricon-cnrt4.20-devel-centos`

type CudaVersion =
| '10.2'
Expand Down Expand Up @@ -144,6 +145,7 @@ function getCUDAImageByVersion(cudaVersion: CudaVersion): string {
}
type ComputePlatform =
| 'cpu'
| 'mlu'
| 'cu101'
| 'cu102'
| 'cu110'
Expand All @@ -162,6 +164,8 @@ function getCUDAVersionByComputePlatform(
switch (computePlatform) {
case 'cpu':
return 'none'
case 'mlu':
return 'none'
case 'cu102':
return '10.2'
case 'cu110':
Expand Down Expand Up @@ -207,7 +211,12 @@ export async function buildWithCondaOrManyLinux(): Promise<void> {
break
case 'manylinux':
if (isSelfHosted()) {
const tag = getCUDAImageByVersion(cudaVersion)
let tag = ''
if (computePlatform === 'mlu') {
tag = CUDA_MLU_IMG_TAG
} else {
tag = getCUDAImageByVersion(cudaVersion)
}
await exec.exec('docker', ['pull', tag])
await buildOneFlow(tag)
} else {
Expand Down
15 changes: 14 additions & 1 deletion src/utils/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,17 @@ async function buildAndMakeWheel(
[],
nvLibs.map((nvLib: string) => ['--exclude', nvLib])
)
const mluLibs: string[] = [
'libcncl.so.1',
'libcndev.so',
'libcndrv.so',
'libcnnl.so.1',
'libcnrt.so'
]
const mluLibsExcludes = Array.prototype.concat.apply(
[],
mluLibs.map((nvLib: string) => ['--exclude', nvLib])
)
if (shouldAuditWheel) {
postProcessCmds = postProcessCmds.concat(
whlFiles.map(async (whl: string) =>
Expand All @@ -198,7 +209,9 @@ async function buildAndMakeWheel(
whl,
'--wheel-dir',
wheelhouseDir
].concat(nvLibsExcludes),
]
.concat(nvLibsExcludes)
.concat(mluLibsExcludes),
{cwd: distDir}
)
)
Expand Down