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
fd0d1d99
Unverified
Commit
fd0d1d99
authored
Dec 14, 2021
by
J-shang
Committed by
GitHub
Dec 14, 2021
Browse files
update interim patch (#4383)
parent
219136f6
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
28 deletions
+43
-28
Dockerfile
Dockerfile
+2
-2
interim_vision_patch.py
interim_vision_patch.py
+0
-20
pipelines/fast-test.yml
pipelines/fast-test.yml
+20
-2
pipelines/integration-test-hybrid.yml
pipelines/integration-test-hybrid.yml
+2
-2
pipelines/integration-test-remote-l2l.yml
pipelines/integration-test-remote-l2l.yml
+2
-2
test/vso_tools/interim_patch.py
test/vso_tools/interim_patch.py
+17
-0
No files found.
Dockerfile
View file @
fd0d1d99
...
@@ -80,8 +80,8 @@ RUN python3 -m pip install nni-${NNI_RELEASE}-py3-none-manylinux1_x86_64.whl
...
@@ -80,8 +80,8 @@ RUN python3 -m pip install nni-${NNI_RELEASE}-py3-none-manylinux1_x86_64.whl
#
#
# Vision patch. Need del later
# Vision patch. Need del later
#
#
COPY
interim
_vision
_patch.py .
COPY
test/vso_tools/
interim_patch.py .
RUN
python3 interim_
vision_
patch.py
RUN
python3 interim_patch.py
#
#
# install aml package
# install aml package
...
...
interim_vision_patch.py
deleted
100644 → 0
View file @
219136f6
import
os
import
torchvision.datasets.mnist
as
mnist
file_name
=
mnist
.
__file__
dummy_file_name
=
os
.
path
.
join
(
os
.
path
.
dirname
(
file_name
),
'mnist_dummy.py'
)
with
open
(
file_name
,
'r'
)
as
fr
,
open
(
dummy_file_name
,
'w'
)
as
fw
:
origin_text
=
fr
.
read
()
mnist_head
=
origin_text
.
find
(
'class MNIST('
)
reasource_head
=
origin_text
.
find
(
'resources = ['
,
mnist_head
)
reasource_tail
=
origin_text
.
find
(
']
\n
'
,
reasource_head
)
top
=
origin_text
[:
reasource_head
]
reasource
=
"resources = [('https://ossci-datasets.s3.amazonaws.com/mnist/train-images-idx3-ubyte.gz', 'f68b3c2dcbeaaa9fbdd348bbdeb94873'),('https://ossci-datasets.s3.amazonaws.com/mnist/train-labels-idx1-ubyte.gz', 'd53e105ee54ea40749a09fcbcd1e9432'),('https://ossci-datasets.s3.amazonaws.com/mnist/t10k-images-idx3-ubyte.gz', '9fb629c4189551a2d022fa330f9573f3'),('https://ossci-datasets.s3.amazonaws.com/mnist/t10k-labels-idx1-ubyte.gz', 'ec29112dd5afa0611ce80d1b7f02629c')]
\n
"
bottom
=
origin_text
[
reasource_tail
+
2
:]
fw
.
write
(
top
)
fw
.
write
(
reasource
)
fw
.
write
(
bottom
)
if
os
.
path
.
exists
(
dummy_file_name
):
os
.
remove
(
file_name
)
os
.
rename
(
dummy_file_name
,
file_name
)
pipelines/fast-test.yml
View file @
fd0d1d99
...
@@ -179,6 +179,12 @@ stages:
...
@@ -179,6 +179,12 @@ stages:
python -m pip install -e .[PPOTuner,DNGO]
python -m pip install -e .[PPOTuner,DNGO]
displayName
:
Install extra dependencies
displayName
:
Install extra dependencies
# Need del later
-
script
:
|
set -e
python test/vso_tools/interim_patch.py
displayName
:
Torch utils tensorboard interim patch
-
script
:
|
-
script
:
|
set -e
set -e
cd test
cd test
...
@@ -281,8 +287,8 @@ stages:
...
@@ -281,8 +287,8 @@ stages:
# Need del later
# Need del later
-
script
:
|
-
script
:
|
set -e
set -e
python interim
_vision
_patch.py
python
test/vso_tools/
interim_patch.py
displayName
:
Vision MNIST P
atch
displayName
:
Torch utils tensorboard interim p
atch
-
script
:
|
-
script
:
|
...
@@ -368,6 +374,12 @@ stages:
...
@@ -368,6 +374,12 @@ stages:
python -m pip install -e .[SMAC,BOHB,PPOTuner,DNGO]
python -m pip install -e .[SMAC,BOHB,PPOTuner,DNGO]
displayName
:
Install extra dependencies
displayName
:
Install extra dependencies
# Need del later
-
script
:
|
set -e
python test/vso_tools/interim_patch.py
displayName
:
Torch utils tensorboard interim patch
-
script
:
|
-
script
:
|
cd test
cd test
python -m pytest ut
python -m pytest ut
...
@@ -429,6 +441,12 @@ stages:
...
@@ -429,6 +441,12 @@ stages:
python -m pip install -e .[DNGO]
python -m pip install -e .[DNGO]
displayName
:
Install extra dependencies
displayName
:
Install extra dependencies
# Need del later
-
script
:
|
set -e
python test/vso_tools/interim_patch.py
displayName
:
Torch utils tensorboard interim patch
-
script
:
|
-
script
:
|
cd test
cd test
python -m pytest ut
python -m pytest ut
...
...
pipelines/integration-test-hybrid.yml
View file @
fd0d1d99
...
@@ -62,10 +62,10 @@ jobs:
...
@@ -62,10 +62,10 @@ jobs:
-
task
:
CopyFilesOverSSH@0
-
task
:
CopyFilesOverSSH@0
inputs
:
inputs
:
sshEndpoint
:
$(worker)
sshEndpoint
:
$(worker)
contents
:
interim
_vision
_patch.py
contents
:
test/vso_tools/
interim_patch.py
targetFolder
:
/tmp/nnitest/$(Build.BuildId)
targetFolder
:
/tmp/nnitest/$(Build.BuildId)
overwrite
:
true
overwrite
:
true
displayName
:
Copy
vision
patch to remote machine
displayName
:
Copy
torch
patch to remote machine
timeoutInMinutes
:
10
timeoutInMinutes
:
10
-
task
:
SSH@0
-
task
:
SSH@0
...
...
pipelines/integration-test-remote-l2l.yml
View file @
fd0d1d99
...
@@ -67,10 +67,10 @@ jobs:
...
@@ -67,10 +67,10 @@ jobs:
-
task
:
CopyFilesOverSSH@0
-
task
:
CopyFilesOverSSH@0
inputs
:
inputs
:
sshEndpoint
:
$(worker)
sshEndpoint
:
$(worker)
contents
:
interim
_vision
_patch.py
contents
:
test/vso_tools/
interim_patch.py
targetFolder
:
/tmp/nnitest/$(Build.BuildId)
targetFolder
:
/tmp/nnitest/$(Build.BuildId)
overwrite
:
true
overwrite
:
true
displayName
:
Copy
vision
patch to remote machine
displayName
:
Copy
torch
patch to remote machine
timeoutInMinutes
:
10
timeoutInMinutes
:
10
-
task
:
SSH@0
-
task
:
SSH@0
...
...
test/vso_tools/interim_patch.py
0 → 100644
View file @
fd0d1d99
# fix setuptools.distutils import in torch
import
os
from
torch
import
utils
file_name
=
os
.
path
.
join
(
os
.
path
.
dirname
(
utils
.
__file__
),
'tensorboard/__init__.py'
)
dummy_file_name
=
os
.
path
.
join
(
os
.
path
.
dirname
(
file_name
),
'__dummy_init__.py'
)
if
os
.
path
.
exists
(
file_name
):
with
open
(
file_name
,
'r'
)
as
fr
,
open
(
dummy_file_name
,
'w'
)
as
fw
:
origin_text
=
fr
.
read
()
patched_text
=
origin_text
.
replace
(
'from setuptools import distutils'
,
''
,
1
)
patched_text
=
patched_text
.
replace
(
'LooseVersion = distutils.version.LooseVersion'
,
'from distutils.version import LooseVersion'
,
1
)
patched_text
=
patched_text
.
replace
(
'del distutils'
,
''
,
1
)
fw
.
write
(
patched_text
)
if
os
.
path
.
exists
(
dummy_file_name
):
os
.
remove
(
file_name
)
os
.
rename
(
dummy_file_name
,
file_name
)
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