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
Torchaudio
Commits
3d4f256a
Unverified
Commit
3d4f256a
authored
Jul 31, 2019
by
Edward Z. Yang
Committed by
GitHub
Jul 31, 2019
Browse files
Support for building nightlies on master. (#193)
Signed-off-by:
Edward Z. Yang
<
ezyang@fb.com
>
parent
817c1cd6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
17 deletions
+37
-17
build_tools/packaging/wheel/linux_manywheel.sh
build_tools/packaging/wheel/linux_manywheel.sh
+16
-10
build_tools/packaging/wheel/osx_wheel.sh
build_tools/packaging/wheel/osx_wheel.sh
+13
-4
setup.py
setup.py
+8
-3
No files found.
build_tools/packaging/wheel/linux_manywheel.sh
View file @
3d4f256a
if
[
"$#"
-ne
1
]
;
then
#!/bin/bash
echo
"Illegal number of parameters. Pass cuda version"
echo
"CUDA version should be cu90, cu100 or cpu"
set
-ex
exit
1
fi
export
TORCHAUDIO_PACKAGE_NAME
=
"torchaudio_nightly"
export
CUVER
=
"
$1
"
# cu90 cu100 cpu
export
TORCHAUDIO_BUILD_VERSION
=
"0.4.0.dev
$(
date
"+%Y%m%d"
)
"
export
TORCHAUDIO_BUILD_VERSION
=
"0.2.0"
export
TORCHAUDIO_BUILD_NUMBER
=
"1"
export
TORCHAUDIO_BUILD_NUMBER
=
"1"
export
OUT_DIR
=
"/remote/
$CUVER
"
export
OUT_DIR
=
"/remote/
cpu
"
cd
/opt/python
cd
/opt/python
DESIRED_PYTHON
=(
*
/
)
DESIRED_PYTHON
=(
*
/
)
...
@@ -18,7 +16,7 @@ done
...
@@ -18,7 +16,7 @@ done
OLD_PATH
=
$PATH
OLD_PATH
=
$PATH
cd
/tmp
cd
/tmp
rm
-rf
audio
rm
-rf
audio
git clone https://github.com/pytorch/audio
-b
v
${
TORCHAUDIO_BUILD_VERSION
}
git clone https://github.com/pytorch/audio
mkdir
audio/third_party
mkdir
audio/third_party
export
PREFIX
=
"/tmp"
export
PREFIX
=
"/tmp"
...
@@ -33,6 +31,14 @@ for PYDIR in "${python_installations[@]}"; do
...
@@ -33,6 +31,14 @@ for PYDIR in "${python_installations[@]}"; do
fi
fi
export
PATH
=
$PYDIR
/bin:
$OLD_PATH
export
PATH
=
$PYDIR
/bin:
$OLD_PATH
pip
install
--upgrade
pip
pip
install
--upgrade
pip
export
TORCHAUDIO_PYTORCH_DEPENDENCY_NAME
=
torch_nightly
pip
install
torch_nightly
-f
https://download.pytorch.org/whl/nightly/torch_nightly.html
# CPU/CUDA variants of PyTorch have ABI compatible PyTorch. Therefore, we
# strip off the local package qualifier
export
TORCHAUDIO_PYTORCH_DEPENDENCY_VERSION
=
"
$(
pip show torch_nightly |
grep
^Version: |
sed
's/Version: \+//'
|
sed
's/+.\+//'
)
"
echo
"Building against
${
TORCHAUDIO_PYTORCH_DEPENDENCY_VERSION
}
"
pip
install
-r
requirements.txt
pip
install
-r
requirements.txt
IS_WHEEL
=
1 python setup.py clean
IS_WHEEL
=
1 python setup.py clean
IS_WHEEL
=
1 python setup.py bdist_wheel
IS_WHEEL
=
1 python setup.py bdist_wheel
...
...
build_tools/packaging/wheel/osx_wheel.sh
View file @
3d4f256a
#!/bin/bash
set
-ex
if
[[
":
$PATH
:"
==
*
"conda"
*
]]
;
then
if
[[
":
$PATH
:"
==
*
"conda"
*
]]
;
then
echo
"existing anaconda install in PATH, remove it and run script"
echo
"existing anaconda install in PATH, remove it and run script"
exit
1
exit
1
...
@@ -11,19 +15,18 @@ wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh &
...
@@ -11,19 +15,18 @@ wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh &
.
~/minconda_wheel_env_tmp/bin/activate
.
~/minconda_wheel_env_tmp/bin/activate
export
TORCHAUDIO_BUILD_VERSION
=
"0.2.0"
export
TORCHAUDIO_PACKAGE_NAME
=
"torchaudio_nightly"
export
TORCHAUDIO_BUILD_VERSION
=
"0.4.0.dev
$(
date
"+%Y%m%d"
)
"
export
TORCHAUDIO_BUILD_NUMBER
=
"1"
export
TORCHAUDIO_BUILD_NUMBER
=
"1"
export
OUT_DIR
=
~/torchaudio_wheels
export
OUT_DIR
=
~/torchaudio_wheels
export
MACOSX_DEPLOYMENT_TARGET
=
10.9
CC
=
clang
CXX
=
clang++
export
MACOSX_DEPLOYMENT_TARGET
=
10.9
CC
=
clang
CXX
=
clang++
# TODO remove when pytorch is good https://github.com/pytorch/pytorch/issues/20030
brew
install
libomp
CURR_PATH
=
$(
pwd
)
CURR_PATH
=
$(
pwd
)
cd
/tmp
cd
/tmp
rm
-rf
audio
rm
-rf
audio
git clone https://github.com/pytorch/audio
-b
v
${
TORCHAUDIO_BUILD_VERSION
}
git clone https://github.com/pytorch/audio
mkdir
audio/third_party
mkdir
audio/third_party
export
PREFIX
=
"/tmp"
export
PREFIX
=
"/tmp"
...
@@ -40,6 +43,12 @@ do
...
@@ -40,6 +43,12 @@ do
conda create
-yn
$env_name
python
=
"
$desired_python
"
conda create
-yn
$env_name
python
=
"
$desired_python
"
conda activate
$env_name
conda activate
$env_name
export
TORCHAUDIO_PYTORCH_DEPENDENCY_NAME
=
torch_nightly
pip
install
torch_nightly
-f
https://download.pytorch.org/whl/nightly/torch_nightly.html
# NB: OS X builds don't have local package qualifiers
export
TORCHAUDIO_PYTORCH_DEPENDENCY_VERSION
=
"
$(
pip show torch_nightly |
grep
^Version: |
sed
's/Version: \+//'
)
"
echo
"Building against
${
TORCHAUDIO_PYTORCH_DEPENDENCY_VERSION
}
"
# install torchaudio dependencies
# install torchaudio dependencies
pip
install
-r
requirements.txt
pip
install
-r
requirements.txt
...
...
setup.py
View file @
3d4f256a
...
@@ -81,10 +81,15 @@ with open(version_path, 'w') as f:
...
@@ -81,10 +81,15 @@ with open(version_path, 'w') as f:
f
.
write
(
"git_version = {}
\n
"
.
format
(
repr
(
sha
)))
f
.
write
(
"git_version = {}
\n
"
.
format
(
repr
(
sha
)))
pytorch_package_name
=
os
.
getenv
(
'TORCHAUDIO_PYTORCH_DEPENDENCY_NAME'
,
'torch'
)
pytorch_package_name
=
os
.
getenv
(
'TORCHAUDIO_PYTORCH_DEPENDENCY_NAME'
,
'torch'
)
pytorch_package_version
=
os
.
getenv
(
'TORCHAUDIO_PYTORCH_DEPENDENCY_VERSION'
)
pytorch_package_dep
=
pytorch_package_name
if
pytorch_package_version
is
not
None
:
pytorch_package_dep
+=
"=="
+
pytorch_package_version
setup
(
setup
(
name
=
"torchaudio"
,
name
=
os
.
getenv
(
'TORCHAUDIO_PACKAGE_NAME'
,
"torchaudio"
)
,
version
=
"0.2"
,
version
=
version
,
description
=
"An audio package for PyTorch"
,
description
=
"An audio package for PyTorch"
,
url
=
"https://github.com/pytorch/audio"
,
url
=
"https://github.com/pytorch/audio"
,
author
=
"Soumith Chintala, David Pollack, Sean Naren, Peter Goldsborough"
,
author
=
"Soumith Chintala, David Pollack, Sean Naren, Peter Goldsborough"
,
...
@@ -117,5 +122,5 @@ setup(
...
@@ -117,5 +122,5 @@ setup(
extra_link_args
=
ela
),
extra_link_args
=
ela
),
],
],
cmdclass
=
{
'build_ext'
:
BuildExtension
},
cmdclass
=
{
'build_ext'
:
BuildExtension
},
install_requires
=
[
pytorch_package_
name
]
install_requires
=
[
pytorch_package_
dep
]
)
)
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