-
-
Notifications
You must be signed in to change notification settings - Fork 82
/
meta.yaml
502 lines (488 loc) · 21.1 KB
/
meta.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
{% set version = "2.17.0" %}
{% set estimator_version = "2.15.0" %}
{% set build = 3 %}
{% if cuda_compiler_version != "None" %}
{% set build = build + 200 %}
{% endif %}
# 2.17.0.rc1 uses unreleased commit
# https://github.com/jax-ml/ml_dtypes/commit/24084d9ed2c3d45bf83b7a9bff833aa185bf9172
# see
# https://github.com/tensorflow/tensorflow/blob/v2.17.0-rc1/third_party/py/ml_dtypes/workspace.bzl
{% set ml_dtypes_version = "0.4.0" %}
package:
name: tensorflow-split
version: {{ version }}
source:
- url: https://github.com/tensorflow/tensorflow/archive/refs/tags/v{{ version.replace(".rc", "-rc") }}.tar.gz
sha256: 9cc4d5773b8ee910079baaecb4086d0c28939f024dd74b33fc5e64779b6533dc
patches:
- patches/0001-loosen-requirements.patch
- patches/0002-Add-additional-absl_synchronization-linkage-to-gRPC.patch
- patches/0003-Fix-missing-abseil-linkages.patch
- patches/0004-Fix-protobuf_python-for-systemlibs.patch
- patches/0005-Add-absl_log-systemlib.patch
- patches/0006-Omit-linking-to-layout_proto_cc-if-protobuf-linkage-.patch
- patches/0007-Fix-further-abseil-linkage.patch
- patches/0008-Add-constraint-to-pybind11-systemlib.patch
- patches/0009-Different-file-ending-for-flatbuffers-LICENSE.patch
- patches/0010-Use-correct-hermetic-python.patch
- patches/0011-Add-well_known_types_py_pb2-to-protobuf-systemlib.patch
- patches/0012-Add-protobuf-toolchain.patch
- patches/0013-fix-genproto.patch
- patches/0014-Remove-some-usage-of-absl-str_format-in-CUDA.patch # [(cuda_compiler_version or "").startswith("11")]
- patches/0015-Adjust-relative-path-for-libdevice.patch # [(cuda_compiler_version or "").startswith("11")]
- patches/0016-Link-to-absl_log_flags-instead-of-absl_flags.patch
- patches/0017-Update-ABSL-Log-Definition-for-libabsl_vlog_config_i.patch
- patches/0018-add-absl_string_view-target.patch
- patches/0019-add-absl_nullability-target.patch
- patches/0020-add-absl_prefetch-target.patch
- patches/0021-add-absl_die_if_null-target.patch
- patches/0022-add-absl_crc32c-targets.patch
- patches/0023-add-kernel_timeout_internal-target.patch
- patches/0024-work-around-for-warning-that-clang-falsely-treats-as.patch
- patches/0025-Hardcode-BUILD_PREFIX-in-build_pip_package.patch
- patches/0026-Only-link-to-sparse_core_layout_proto_cc-headers.patch
- patches/0027-Protobuf-5-compatability.patch
- url: https://github.com/tensorflow/estimator/archive/refs/tags/v{{ estimator_version.replace(".rc", "-rc") }}.tar.gz
sha256: 2d7e100b1878084da34b5e23b49a0cbb5ee8a7add74b7dd189a82ada1cf85530
folder: tensorflow-estimator
build:
number: {{ build }}
skip: true # [win]
skip: true # [python_impl == 'pypy']
skip: true # [py<39]
# The following skip can be removed when the absl::StrFormat build issues are fixed.
skip: true # [cuda_compiler_version == "11.8"]
requirements:
build:
- perl # [linux]
- python # [build_platform != target_platform]
- cython # [build_platform != target_platform]
- cross-python_{{ target_platform }} # [build_platform != target_platform]
- nsync # [build_platform != target_platform]
- snappy # [build_platform != target_platform]
- giflib # [build_platform != target_platform]
- libjpeg-turbo # [build_platform != target_platform]
- icu # [build_platform != target_platform]
- libpng # [build_platform != target_platform]
- flatbuffers # [build_platform != target_platform]
- onednn # [build_platform != target_platform]
- onednn-cpu-threadpool # [build_platform != target_platform]
- pybind11 # [build_platform != target_platform]
- numpy # [build_platform != target_platform]
- {{ compiler('c') }}
- {{ stdlib("c") }}
- {{ compiler('cxx') }}
- {{ compiler('cuda') }} # [cuda_compiler_version != "None"]
- bazel 6.*
- libgrpc
- libprotobuf
- nasm
- patchelf
- sed
- rsync
# realpath is not available from the docker image for cuda <= 10.2
# so we install coreutils here
- coreutils # [cuda_compiler_version != "None"]
host:
# GPU requirements for CUDA
- cudnn # [cuda_compiler_version != "None"]
- nccl # [cuda_compiler_version != "None"]
- cuda-version {{ cuda_compiler_version }} # [cuda_compiler_version != "None"]
- cuda-cupti-dev # [(cuda_compiler_version or "").startswith("12")]
- cuda-cudart-dev # [(cuda_compiler_version or "").startswith("12")]
- cuda-nvml-dev # [(cuda_compiler_version or "").startswith("12")]
- cuda-nvtx-dev # [(cuda_compiler_version or "").startswith("12")]
- libcublas-dev # [(cuda_compiler_version or "").startswith("12")]
- libcusolver-dev # [(cuda_compiler_version or "").startswith("12")]
- libcurand-dev # [(cuda_compiler_version or "").startswith("12")]
- libcufft-dev # [(cuda_compiler_version or "").startswith("12")]
- libcusparse-dev # [(cuda_compiler_version or "").startswith("12")]
# conda build requirements
- python
- pip
- setuptools
- packaging
- zlib
- libpng
- libcurl
- curl # [win]
- unzip # [not win]
- zip # [not win]
- m2-unzip # [win]
- m2-zip # [win]
- openjdk >=8
- nsync
# TF_SYSTEM_LIBS, see usage in
# https://github.com/tensorflow/tensorflow/blob/v{{ version }}/third_party/systemlibs/syslibs_configure.bzl
# their versions are specified in
# https://github.com/tensorflow/tensorflow/blob/v{{ version }}/tensorflow/workspace2.bzl
# but so far there have been no problems with leaving these
# unpinned; though some restrictions come in for packages
# that are also listed as a requirement for the pip_package.
- libabseil
- astor
- cython
- dill
- giflib
- libgrpc
- flatbuffers
- icu
- libjpeg-turbo
- libpng
- libprotobuf
- libprotobuf-python-headers
- openssl
- pybind11
- sqlite
- snappy
- zlib
outputs:
# 2021/12/29: hmaarrfk
# as of tensorflow 2.7.0 we need the tensorflow-base package to break
# circular dependency when buliding tensorflow extra packages This annoying
# circularity is broken upstream by the fact that they have to bootstrap
# their builds
- name: tensorflow-base
script: build_pkg.sh # [unix]
script: build_pkg.bat # [win]
build:
string: cuda{{ cuda_compiler_version | replace('.', '') }}py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"]
string: cpu_py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"]
# weigh down cpu implementation and give cuda preference
track_features:
- tensorflow-cpu # [cuda_compiler_version == "None"]
entry_points:
- toco_from_protos = tensorflow.lite.toco.python.toco_from_protos:main
- tflite_convert = tensorflow.lite.python.tflite_convert:main
- toco = tensorflow.lite.python.tflite_convert:main
- saved_model_cli = tensorflow.python.tools.saved_model_cli:main
# The tensorboard package adds this entry point.
# - tensorboard = tensorboard.main:run_main
- tf_upgrade_v2 = tensorflow.tools.compatibility.tf_upgrade_v2_main:main
- estimator_ckpt_converter = tensorflow_estimator.python.estimator.tools.checkpoint_converter:main
requirements:
# build requirements needs to pick up the compiler run_exports
build:
- {{ compiler('c') }}
- {{ stdlib("c") }}
- {{ compiler('cxx') }}
- {{ compiler('cuda') }} # [cuda_compiler_version != "None"]
- python # [build_platform != target_platform]
- cross-python_{{ target_platform }} # [build_platform != target_platform]
host:
# GPU reuqirements
- cudnn # [cuda_compiler_version != "None"]
- nccl # [cuda_compiler_version != "None"]
- cuda-version {{ cuda_compiler_version }} # [cuda_compiler_version != "None"]
- cuda-cupti-dev # [(cuda_compiler_version or "").startswith("12")]
- cuda-cudart-dev # [(cuda_compiler_version or "").startswith("12")]
- cuda-nvml-dev # [(cuda_compiler_version or "").startswith("12")]
- cuda-nvtx-dev # [(cuda_compiler_version or "").startswith("12")]
- libcublas-dev # [(cuda_compiler_version or "").startswith("12")]
- libcusolver-dev # [(cuda_compiler_version or "").startswith("12")]
- libcurand-dev # [(cuda_compiler_version or "").startswith("12")]
- libcufft-dev # [(cuda_compiler_version or "").startswith("12")]
- libcusparse-dev # [(cuda_compiler_version or "").startswith("12")]
# conda build requirements
- python
- pip
- setuptools
- packaging
- wheel
# TF_SYSTEM_LIBS
- libabseil
- astor
- cython
- dill
- giflib
- libgrpc
- flatbuffers
- icu
- libjpeg-turbo
- libcurl
- libpng
- libprotobuf
- libprotobuf-python-headers
- openssl
- pybind11
- snappy
- sqlite
- zlib
# requirements specified by the package itself, see
# github.com/tensorflow/tensorflow/blob/v{{ version }}/tensorflow/tools/pip_package/setup.py
- absl-py >=1.0.0
- astunparse >=1.6.0
- gast >=0.2.1,!=0.5.0,!=0.5.1,!=0.5.2
- google-pasta >=0.1.1
- h5py >=3.10
- ml_dtypes >={{ ml_dtypes_version }},<0.5
- numpy
- opt_einsum >=2.3.2
# simplified compared to upstream due to constraints arising through libprotobuf
- protobuf >=5.26,<6
- python-flatbuffers >=24.3.25
- requests >=2.21.0,<3
- six >=1.12
- termcolor >=1.1.0
- typing_extensions >=3.6.6
- wrapt >=1.11.0
# TF-API needs to move in sync
- tensorboard >=2.17,<2.18
- keras >=3.0
run:
- python
- packaging
- absl-py >=1.0.0
- astunparse >=1.6.0
- gast >=0.2.1,!=0.5.0,!=0.5.1,!=0.5.2
- google-pasta >=0.1.1
- grpcio {{ libgrpc }}.*
- h5py >=3.10
- ml_dtypes >={{ ml_dtypes_version }},<0.5
- opt_einsum >=2.3.2
- protobuf >=5.26,<6
- python-flatbuffers >=24.3.25
- requests >=2.21.0,<3
- six >=1.12
- termcolor >=1.1.0
- typing_extensions >=3.6.6
- wrapt >=1.11.0
# TF-API needs to move in sync
- tensorboard >=2.17,<2.18
- keras >=3.0
# avoid that people without GPUs needlessly download ~0.5-1GB
- __cuda # [cuda_compiler_version != "None"]
# https://github.com/conda-forge/tensorflow-feedstock/issues/296#issuecomment-1835781851
- cuda-nvcc-tools # [(cuda_compiler_version or "").startswith("12")]
# TODO: decide on the name of the package
# run_constrained:
# What is the difference between these two packages?
# - tensorflow-io-gcs-filesystem >=0.21.0
# - tensorflow-io >=0.21.0
test:
commands:
- exit 0
- name: tensorflow
build:
string: cuda{{ cuda_compiler_version | replace('.', '') }}py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"]
string: cpu_py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"]
# weigh down cpu implementation and give cuda preference
track_features:
- tensorflow-cpu # [cuda_compiler_version == "None"]
requirements:
host:
# Require python so that the CONDA_PY gets populated
- python
# Keep the cuda version here since it helps package solvers
# decide on the cuda variant
- cuda-version {{ cuda_compiler_version }} # [cuda_compiler_version != "None"]
run:
- python
- {{ pin_subpackage('tensorflow-base', exact=True) }}
- {{ pin_subpackage('tensorflow-estimator', exact=True) }}
# avoid that people without GPUs needlessly download ~0.5-1GB
# This also helps mamba give preference to the CPU build
- __cuda # [cuda_compiler_version != "None"]
test:
files:
- test_tensorflow.py
requires:
- pip
imports:
- tensorflow
commands:
- pip check # [build_platform == target_platform]
- cat test_tensorflow.py # [unix]
- python test_tensorflow.py # [build_platform == target_platform]
- tf_upgrade_v2 --help # [build_platform == target_platform]
# --help exits with exit code 1
- test -x $PREFIX/bin/saved_model_cli # [unix]
- tflite_convert --help # [build_platform == target_platform]
- toco_from_protos --help # [build_platform == target_platform]
- toco --help # [build_platform == target_platform]
- python -c 'import tensorflow as tf; assert tf.test.is_built_with_cuda()' # [cuda_compiler_version != "None"]
- python -c 'import tensorflow as tf; assert not tf.test.is_built_with_cuda()' # [cuda_compiler_version == "None"]
# See https://github.com/conda-forge/tensorflow-feedstock/issues/364
- python -c "import tensorflow as tf;graph = tf.function(lambda x:x).get_concrete_function(1.).graph;tf.compat.v1.train.export_meta_graph(graph=graph,graph_def=graph.as_graph_def())"
- name: tensorflow-estimator
script: build_estimator.sh # [unix]
script: build_estimator.bat # [win]
build:
string: cuda{{ cuda_compiler_version | replace('.', '') }}py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"]
string: cpu_py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"]
requirements:
build:
- {{ compiler('c') }}
- {{ stdlib("c") }}
- {{ compiler('cxx') }}
# Keep the cuda compiler here since it helps package solvers
# decide on the cuda variant
# https://github.com/conda-forge/tensorflow-feedstock/issues/162
- {{ compiler('cuda') }} # [cuda_compiler_version != "None"]
- bazel 6.*
- python # [build_platform != target_platform]
- cross-python_{{ target_platform }} # [build_platform != target_platform]
- libabseil # [build_platform != target_platform]
- libgrpc # [build_platform != target_platform]
- icu # [build_platform != target_platform]
- {{ pin_subpackage('tensorflow-base') }} # [build_platform != target_platform]
host:
- python
- pip
- packaging
- setuptools
- wheel
# This ensures that a consistent version of openssl is chosen between
# all packages.
# https://github.com/conda-forge/conda-forge.github.io/issues/1528
- openssl
- {{ pin_subpackage('tensorflow-base', exact=True) }}
# Keep the cuda version here since it helps package solvers
# decide on the cuda variant
- cuda-version {{ cuda_compiler_version }} # [cuda_compiler_version != "None"]
run:
- python
- {{ pin_subpackage('tensorflow-base', exact=True) }}
test:
requires:
- pip
commands:
- pip check # [build_platform == target_platform]
- name: libtensorflow
script: cp_libtensorflow.sh
build:
skip: true # [win]
string: cuda{{ cuda_compiler_version | replace('.', '') }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"]
string: cpu_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"]
run_exports:
# tensorflow makes no ABI guarantees, need to pin to what we built with
- libtensorflow {{ version }}
requirements:
# build requirements needs to pick up the compiler run_exports
build:
- {{ compiler('c') }}
- {{ stdlib("c") }}
- {{ compiler('cxx') }}
# Keep the cuda compiler here since it helps package solvers
# decide on the cuda variant
# https://github.com/conda-forge/tensorflow-feedstock/issues/162
- {{ compiler('cuda') }} # [cuda_compiler_version != "None"]
# host requirements to pick up run_exports
host:
- libabseil
- giflib
- libgrpc
- icu
- libjpeg-turbo
- libcurl
- libpng
- libprotobuf
- openssl
- snappy
- sqlite
- zlib
run:
# avoid that people without GPUs needlessly download ~200-300MB
- __cuda # [cuda_compiler_version != "None"]
test:
files:
- test_libtensorflow.sh
- test_c.c
requires:
- {{ compiler('c') }}
commands:
- test -f $PREFIX/lib/libtensorflow${SHLIB_EXT} # [cuda_compiler_version == "None"]
- ./test_libtensorflow.sh # [cuda_compiler_version == "None" and build_platform == target_platform]
- name: libtensorflow_cc
script: cp_libtensorflow_cc.sh
build:
skip: true # [win]
string: cuda{{ cuda_compiler_version | replace('.', '') }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"]
string: cpu_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"]
run_exports:
# tensorflow makes no ABI guarantees, need to pin to what we built with
- libtensorflow_cc {{ version }}
requirements:
# build requirements needs to pick up the compiler run_exports
build:
- {{ compiler('c') }}
- {{ stdlib("c") }}
- {{ compiler('cxx') }}
# Keep the cuda compiler here since it helps package solvers
# decide on the cuda variant
# https://github.com/conda-forge/tensorflow-feedstock/issues/162
- {{ compiler('cuda') }} # [cuda_compiler_version != "None"]
- rsync
# host requirements to pick up run_exports
host:
- flatbuffers
- giflib
- icu
- libabseil
- libcurl
- libgrpc
- libjpeg-turbo
- libpng
- libprotobuf
- openssl
- snappy
- sqlite
- zlib
run:
- libml_dtypes-headers >={{ ml_dtypes_version }},<0.5
# avoid that people without GPUs needlessly download ~200-300MB
- __cuda # [cuda_compiler_version != "None"]
test:
files:
- test_libtensorflow_cc.sh
- test_cc.cc
requires:
- {{ compiler('cxx') }}
commands:
- test -f $PREFIX/lib/libtensorflow_cc${SHLIB_EXT} # [not win and cuda_compiler_version == "None"]
- ./test_libtensorflow_cc.sh # [not win and cuda_compiler_version == "None" and build_platform == target_platform]
# 2021/08/01, hmaarrfk
# While this seems like a roundabout way of defining the package name
# It helps the linter avoid errors on a package not having tests.
{% set tensorflow_cpu_gpu = "tensorflow-cpu" %} # [cuda_compiler_version == "None" or cuda_compiler_version is undefined]
{% set tensorflow_cpu_gpu = "tensorflow-gpu" %} # [cuda_compiler_version != "None"]
- name: {{ tensorflow_cpu_gpu }}
build:
string: cuda{{ cuda_compiler_version | replace('.', '') }}py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"]
string: cpu_py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"]
detect_binary_files_with_prefix: false
requirements:
run:
- {{ pin_subpackage("tensorflow", exact=True) }}
test:
imports:
- tensorflow
about:
home: http://tensorflow.org/
license: Apache-2.0
license_file: LICENSE
license_family: Apache
summary: TensorFlow is an end-to-end open source platform for machine learning.
description: |
TensorFlow offers multiple levels of abstraction so you can choose the
right one for your needs. Build and train models by using the high-level
Keras API, which makes getting started with TensorFlow and machine learning
easy.
dev_url: https://github.com/tensorflow/tensorflow
doc_url: https://www.tensorflow.org/get_started/get_started
doc_source_url: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/docs_src
extra:
feedstock-name: tensorflow
recipe-maintainers:
- ngam
- farhantejani
- ghego
- h-vetinari
- hajapy
- jschueller
- njzjz
- waitingkuo
- xhochy
- hmaarrfk
- wolfv