Skip to content

Commit

Permalink
Update TF dependency to 2.12rc0 (#353)
Browse files Browse the repository at this point in the history
* update to 2.11rc2

* update fixedpoint

* update includes

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* update to 2.11

* set jit_compile=False for all optimizers

* format

* test nightly wheel

* update

* training test update

* update to 2.12rc0

* update

* fix scan ops test

* fix slice op test

* fix and update split op test

* fix and update stack op test

* fix and update concat op test

* remove python 3.7

* fix profiler test

* wip

* fix array ops test

* update array ops test

* add python 3.11

* make gpu name cmd line arg

* typo

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* update image ops test, clipbyvalue, format

* fix includes

* fix condition

* small fixes

* updates for code checks

* remove tf TODO and more linting fixes

* remove platform_types

* keep spaces in gpu name
  • Loading branch information
maggie1059 authored Mar 8, 2023
1 parent 4fae0b0 commit 1053cf3
Show file tree
Hide file tree
Showing 29 changed files with 5,255 additions and 3,638 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/github-actions-python-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set Up Python 3.7
- name: Set Up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.7'
python-version: '3.9'
- run: pip install -r requirements.txt
- run: "black . --check --diff --verbose"
- run: pylint *.py
Expand Down
4 changes: 2 additions & 2 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This document contains instructions for producing private builds of tensorflow-d
Your machine must have a few tools installed before you can get started.

- CMake.
- A Python 3.7, 3.8, 3.9 or 3.10 environment with the `wheel` package installed.
- A Python 3.8, 3.9, 3.10 or 3.11 environment with the `wheel` package installed.
- Build tools appropriate for your platform (MSVC on Windows, Clang on Linux).
- Linux: a glibc-based distro, like Ubuntu.

Expand Down Expand Up @@ -65,7 +65,7 @@ This project requires a Python interpreter to produce the TFDML plugin wheel. Th

Feel free to use any version of Python, but we recommend [Miniconda](https://docs.conda.io/en/latest/miniconda.html) to sandbox your project environments. Miniconda is a bundle that includes [Python](https://www.python.org/), a package and environment manager named [Conda](https://docs.conda.io/projects/conda/en/latest/), and a very small set of Python packages. It is a lighter-weight alternative to Anaconda, which contains hundreds of Python packages that aren't necessary for building. See the [user guide](https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html) for more details if you're not familiar with its usage.

Once you've installed Miniconda you will want to create and activate a Python 3.7, 3.8, 3.9 or 3.10 environment with the required packages Use this activated environment when building this project.
Once you've installed Miniconda you will want to create and activate a Python 3.8, 3.9, 3.10, or 3.11 environment with the required packages Use this activated environment when building this project.

**Windows**:

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You can also contact us directly at [email protected].

TensorFlow DirectML Plugin is in early development and is not supported for production yet. For production scenarios, use [TensorFlow 1.15 with DirectML](https://github.com/microsoft/tensorflow-directml) instead.

TensorFlow DirectML Plugin only works with the `tensorflow-cpu==2.10` package, not `tensorflow` or `tensorflow-gpu`. To install the package, run the following commands:
TensorFlow DirectML Plugin only works with the `tensorflow-cpu>=2.12` package, not `tensorflow` or `tensorflow-gpu`. To install the package, run the following commands:

```sh
pip install tensorflow-directml-plugin
Expand All @@ -34,7 +34,7 @@ The following resources provide additional background on DirectML and TensorFlow
### Windows 10

* Windows 10 Version 1709, 64-bit (Build 16299 or higher)
* Python x86-64 3.7, 3.8, 3.9 or 3.10<sup>1</sup>
* Python x86-64 3.8, 3.9, 3.10 or 3.11<sup>1</sup>
* One of the following supported GPUs:
* AMD Radeon R5/R7/R9 2xx series or newer
* Intel HD Graphics 5xx or newer
Expand All @@ -43,7 +43,7 @@ The following resources provide additional background on DirectML and TensorFlow
### Windows Subsystem for Linux

* Windows 10 Insider Preview, 64-bit (Build 20150 or higher)
* Python x86-64 3.7, 3.8, 3.9 or 3.10<sup>2</sup>
* Python x86-64 3.8, 3.9, 3.10 or 3.11<sup>2</sup>
* One of the following supported GPUs:
* AMD Radeon R5/R7/R9 2xx series or newer, and [20.20.01.05 WSL driver](https://www.amd.com/en/support/kb/release-notes/rn-rad-win-wsl-support)
* Intel HD Graphics 6xx or newer, and [28.20.100.8322 WSL driver](https://downloadcenter.intel.com/download/29526)
Expand Down
11 changes: 6 additions & 5 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ if(WIN32)
# URLs and SHA256 hashes for the cp37 versions. For stable builds, go to https://pypi.org/project/tensorflow-intel/#files instead.
FetchContent_Declare(
tensorflow_whl
URL https://files.pythonhosted.org/packages/4a/43/b6c853d9e9532b9dd04191383b76fe5ff7b7dfa40d2be2af98f40c7536ce/tensorflow_intel-2.10.0-cp37-cp37m-win_amd64.whl
URL_HASH SHA256=e6096b3a84bbc57eab88cc39ad7d6148e400a0da6a448f94d5e84c8cdbb521b5
URL https://files.pythonhosted.org/packages/4c/57/3b37cf30bf1549e617f8328c10b1f3237bf50c9ac7be3de6fcb4c73a19ef/tensorflow_intel-2.12.0rc0-cp39-cp39-win_amd64.whl
URL_HASH SHA256=4f6793e0d9238b2fd57f10f39d7b3ab38000e2fca3144c260f581665be35a971
)

FetchContent_Declare(
Expand All @@ -38,8 +38,8 @@ else()
# URLs and SHA256 hashes for the cp37 versions. For stable builds, go to https://pypi.org/project/tensorflow-cpu/#files instead.
FetchContent_Declare(
tensorflow_whl
URL https://files.pythonhosted.org/packages/9b/4b/293733cd86f09760b14517f077f79bad16de4af11828273eda1722e9b03a/tensorflow_cpu-2.10.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
URL_HASH SHA256=34477fdfa97045c854fde55381cc3eb7fa6c63f5958ccf30ae3a21513ee73031
URL https://files.pythonhosted.org/packages/61/f7/5888bb138d8ae9c6400996c3f0ffc2d9034c5213d7c6aa6deea79bbfe2c3/tensorflow_cpu-2.12.0rc0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
URL_HASH SHA256=505921b47561f7b26fef8d1e5d781c4afd9aaba8945b02258d36037f70cdfbef
)

FetchContent_Declare(
Expand Down Expand Up @@ -209,7 +209,6 @@ function(tf_proto_cpp proto_path)
endfunction()

# Generate the necessary .proto files in the TF wheel (performed at build time).
tf_proto_cpp(tensorflow/core/profiler/protobuf/xplane.proto)
tf_proto_cpp(tensorflow/core/framework/graph.proto)
tf_proto_cpp(tensorflow/core/framework/function.proto)
tf_proto_cpp(tensorflow/core/framework/attr_value.proto)
Expand All @@ -224,6 +223,8 @@ tf_proto_cpp(tensorflow/core/framework/versions.proto)
tf_proto_cpp(tensorflow/core/framework/kernel_def.proto)
tf_proto_cpp(tensorflow/core/grappler/costs/op_performance_data.proto)
tf_proto_cpp(tensorflow/core/protobuf/device_properties.proto)
tf_proto_cpp(tensorflow/core/profiler/protobuf/xplane.proto)
tf_proto_cpp(tensorflow/tsl/profiler/protobuf/xplane.proto)

# A python interpreter is required to produce the plugin wheel. This python environment
# must have the 'wheel' package installed.
Expand Down
14 changes: 7 additions & 7 deletions pipelines/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ parameters:
displayName: Build Artifacts
type: object
default:
- x64-win-release-cp37
- x64-win-debug-cp37
- x64-win-debug-cp39
- x64-win-release-cp38
- x64-win-release-cp39
- x64-win-release-cp310
- x64-linux-release-cp37
- x64-linux-debug-cp37
- x64-win-release-cp311
- x64-linux-debug-cp39
- x64-linux-release-cp38
- x64-linux-release-cp39
- x64-linux-release-cp310
- x64-linux-release-cp311

- name: enableTelemetry
displayName: Enable Telemetry
Expand All @@ -59,7 +59,7 @@ parameters:
- name: testArtifacts
displayName: Test Artifacts
type: object
default: [x64-win-release-cp37, x64-linux-release-cp37]
default: [x64-win-release-cp39, x64-linux-release-cp39]

- name: testGroups
displayName: Test Groups
Expand All @@ -74,12 +74,12 @@ parameters:
- name: testTensorflowVersion
displayName: TensorFlow Package Version
type: string
default: 2.10.0
default: 2.12.0rc0

- name: testKerasPackage
displayName: Keras Package Version
type: string
default: keras==2.10.0
default: keras==2.12.0rc0

- name: enableTests
displayName: Enable Tests
Expand Down
11 changes: 7 additions & 4 deletions pipelines/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ parameters:
default: [tensorflow-cpu]
- name: tensorflowVersion
type: string
default: 2.10.0
default: 2.12.0rc0
- name: kerasPackage
type: string
default: keras==2.10.0
default: keras==2.12.0rc0
- name: pluginBuildPipeline
type: string
default: current
Expand Down Expand Up @@ -153,10 +153,12 @@ jobs:
script: |
$ScriptPath = "$(Build.SourcesDirectory)/test/test.py" -replace '\\','/'
$ScriptPathWsl = wsl wslpath -a $ScriptPath
$GPUInfo = wmic path win32_VideoController get name
$ResultsDirWin = "$(System.ArtifactsDirectory)/results/$(agentName)/${{artifact}}/${{tensorflowPackage}}" -replace '\\','/'
$ResultsDirWinWsl = wsl wslpath -a $ResultsDirWin
New-Item -ItemType Directory $ResultsDirWin -Force | Out-Null
cmd /c "wsl $(test_env_linux_${{replace(tensorflowPackage, '-', '_')}}.activateCommand); python $ScriptPathWsl --run --parallel --summarize --redirect_output --results_dir $ResultsDirWinWsl --groups ${{join(' ', parameters.testGroups)}}"
cmd /c "wsl $(test_env_linux_${{replace(tensorflowPackage, '-', '_')}}.activateCommand); python $ScriptPathWsl --run --parallel --summarize --redirect_output --results_dir $ResultsDirWinWsl --groups ${{join(' ', parameters.testGroups)}} --gpu_name '$GPUInfo'"
- ${{if contains(artifact, '-win-') }}:
- task: PowerShell@2
Expand All @@ -180,7 +182,8 @@ jobs:
script: |
Invoke-Expression '$(test_env_win_${{replace(tensorflowPackage, '-', '_')}}.activateCommand)'
$ResultsDir = "$(System.ArtifactsDirectory)/results/$(agentName)/${{artifact}}/${{tensorflowPackage}}"
python $(Build.SourcesDirectory)/test/test.py --run --parallel --summarize --redirect_output --results_dir $ResultsDir --groups ${{join(' ', parameters.testGroups)}}
$GPUInfo = wmic path win32_VideoController get name
python $(Build.SourcesDirectory)/test/test.py --run --parallel --summarize --redirect_output --results_dir $ResultsDir --groups ${{join(' ', parameters.testGroups)}} --gpu_name "$GPUInfo"
- task: PublishBuildArtifacts@1
displayName: Publish ${{artifact}}
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
black==22.6.0
pylint==2.14.5
tensorboard_plugin_profile==2.8.0
tensorflow-cpu==2.10.0
tensorflow-cpu==2.12.0rc0
vswhere==1.4.0 ; sys_platform == 'win32'
portpicker==1.5.2
2 changes: 1 addition & 1 deletion test/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Testing TensorFlow-DirectML-Plugin

This directory contains tests for validating the DirectML plugin. Testing is done with a combination of python scripts and native test executables. The python tests should be run in a python environment with the `tensorflow-directml-plugin` and `tensorflow-cpu == 2.10.0` packages installed. All testing is driven by the following two files:
This directory contains tests for validating the DirectML plugin. Testing is done with a combination of python scripts and native test executables. The python tests should be run in a python environment with the `tensorflow-directml-plugin` and `tensorflow-cpu >= 2.12.0` packages installed. All testing is driven by the following two files:

- [test.py](test.py) : main script that will execute all test content (python and native tests) and summarize the results. Uses tests.json to drive testing.
- [tests.json](tests.json) : describes the test content and how it should be executed.
Expand Down
Loading

0 comments on commit 1053cf3

Please sign in to comment.