Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
8c07cf41
"...composable_kernel_rocm.git" did not exist on "d452452d34c81a970f6fc256c77f03fc05dde0ca"
Commit
8c07cf41
authored
Dec 10, 2019
by
Seung Ho Jang
Committed by
chicm-ms
Dec 10, 2019
Browse files
Add support for zero gpuNum in kubernetes (#1830)
parent
97b258b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
src/nni_manager/training_service/kubernetes/kubernetesTrainingService.ts
.../training_service/kubernetes/kubernetesTrainingService.ts
+9
-4
No files found.
src/nni_manager/training_service/kubernetes/kubernetesTrainingService.ts
View file @
8c07cf41
...
...
@@ -64,11 +64,16 @@ abstract class KubernetesTrainingService {
// tslint:disable:no-any
public
generatePodResource
(
memory
:
number
,
cpuNum
:
number
,
gpuNum
:
number
):
any
{
return
{
const
resources
:
any
=
{
memory
:
`
${
memory
}
Mi`
,
cpu
:
`
${
cpuNum
}
`
,
'
nvidia.com/gpu
'
:
`
${
gpuNum
}
`
cpu
:
`
${
cpuNum
}
`
};
if
(
gpuNum
!==
0
)
{
resources
[
'
nvidia.com/gpu
'
]
=
`
${
gpuNum
}
`
;
}
return
resources
;
}
// tslint:enable:no-any
public
async
listTrialJobs
():
Promise
<
TrialJobDetail
[]
>
{
...
...
@@ -265,7 +270,7 @@ abstract class KubernetesTrainingService {
// Refer https://github.com/NVIDIA/k8s-device-plugin/issues/61
// So we have to explicitly set CUDA_VISIBLE_DEVICES to empty if user sets gpuNum to 0 in NNI config file
if
(
gpuNum
===
0
)
{
nvidiaScript
=
`
export CUDA_VISIBLE_DEVICES='
0'`
;
nvidiaScript
=
'
export CUDA_VISIBLE_DEVICES=
'
;
}
// tslint:disable-next-line: strict-boolean-expressions
const
nniManagerIp
:
string
=
this
.
nniManagerIpConfig
?
this
.
nniManagerIpConfig
.
nniManagerIp
:
getIPV4Address
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment