Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +1 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/jit/__init__.py +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/jit/__pycache__/__init__.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/__init__.py +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/__pycache__/__init__.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/__pycache__/xla_ops.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/__pycache__/xla_ops_grad.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/xla_ops.py +352 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/xla_ops_grad.py +25 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/__init__.py +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/__pycache__/__init__.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/__pycache__/py_function_lib.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/__pycache__/quantize_model.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/__pycache__/representative_dataset.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/__pycache__/save_model.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/py_function_lib.py +770 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/pywrap_function_lib.pyi +48 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/pywrap_function_lib.so +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/pywrap_quantize_model.so +3 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/tensorflow/__init__.py +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/tensorflow/__pycache__/__init__.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/tensorflow/__pycache__/gen_mlir_passthrough_op.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/tensorflow/gen_mlir_passthrough_op.py +127 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/__init__.py +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/__pycache__/__init__.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/__pycache__/xla_data_pb2.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/service/__init__.py +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/service/__pycache__/__init__.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/service/__pycache__/hlo_pb2.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/service/hlo_pb2.py +104 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/tsl/__init__.py +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/tsl/__pycache__/__init__.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/tsl/protobuf/__init__.py +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/tsl/protobuf/__pycache__/__init__.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/tsl/protobuf/__pycache__/bfc_memory_map_pb2.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/tsl/protobuf/__pycache__/test_log_pb2.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/tsl/protobuf/bfc_memory_map_pb2.py +34 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/tsl/protobuf/test_log_pb2.py +68 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/xla_data_pb2.py +148 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/__init__.py +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/__pycache__/__init__.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/proto/__init__.py +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/proto/__pycache__/__init__.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/proto/__pycache__/layout_pb2.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/proto/layout_pb2.py +33 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/python/__init__.py +17 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/python/__pycache__/d_checkpoint.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/python/__pycache__/d_variable.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/python/__pycache__/dtensor_device.cpython-310.pyc +0 -0
- SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/python/__pycache__/gen_dtensor_ops.cpython-310.pyc +0 -0
.gitattributes
CHANGED
|
@@ -206,3 +206,4 @@ SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/lite/expe
|
|
| 206 |
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/core/kernels/libtfkernel_sobol_op.so filter=lfs diff=lfs merge=lfs -text
|
| 207 |
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/ops/_xla_ops.so filter=lfs diff=lfs merge=lfs -text
|
| 208 |
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/stablehlo/stablehlo_extension.so filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 206 |
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/core/kernels/libtfkernel_sobol_op.so filter=lfs diff=lfs merge=lfs -text
|
| 207 |
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/ops/_xla_ops.so filter=lfs diff=lfs merge=lfs -text
|
| 208 |
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/stablehlo/stablehlo_extension.so filter=lfs diff=lfs merge=lfs -text
|
| 209 |
+
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/pywrap_quantize_model.so filter=lfs diff=lfs merge=lfs -text
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/jit/__init__.py
ADDED
|
File without changes
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/jit/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (199 Bytes). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/__init__.py
ADDED
|
File without changes
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (203 Bytes). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/__pycache__/xla_ops.cpython-310.pyc
ADDED
|
Binary file (9.57 kB). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/__pycache__/xla_ops_grad.cpython-310.pyc
ADDED
|
Binary file (652 Bytes). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/xla_ops.py
ADDED
|
@@ -0,0 +1,352 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Python wrappers around TensorFlow ops.
|
| 2 |
+
|
| 3 |
+
This file is MACHINE GENERATED! Do not edit.
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
import collections
|
| 7 |
+
|
| 8 |
+
from tensorflow.python import pywrap_tfe as pywrap_tfe
|
| 9 |
+
from tensorflow.python.eager import context as _context
|
| 10 |
+
from tensorflow.python.eager import core as _core
|
| 11 |
+
from tensorflow.python.eager import execute as _execute
|
| 12 |
+
from tensorflow.python.framework import dtypes as _dtypes
|
| 13 |
+
from tensorflow.security.fuzzing.py import annotation_types as _atypes
|
| 14 |
+
|
| 15 |
+
from tensorflow.python.framework import op_def_registry as _op_def_registry
|
| 16 |
+
from tensorflow.python.framework import ops as _ops
|
| 17 |
+
from tensorflow.python.framework import op_def_library as _op_def_library
|
| 18 |
+
from tensorflow.python.util.deprecation import deprecated_endpoints
|
| 19 |
+
from tensorflow.python.util import dispatch as _dispatch
|
| 20 |
+
from tensorflow.python.util.tf_export import tf_export
|
| 21 |
+
|
| 22 |
+
from typing import TypeVar, List, Any
|
| 23 |
+
from typing_extensions import Annotated
|
| 24 |
+
|
| 25 |
+
TV_XlaClusterOutput_T = TypeVar("TV_XlaClusterOutput_T", _atypes.BFloat16, _atypes.Bool, _atypes.Complex128, _atypes.Complex64, _atypes.Float16, _atypes.Float32, _atypes.Float64, _atypes.Float8e4m3fn, _atypes.Float8e5m2, _atypes.Half, _atypes.Int16, _atypes.Int32, _atypes.Int4, _atypes.Int64, _atypes.Int8, _atypes.QInt16, _atypes.QInt32, _atypes.QInt8, _atypes.QUInt16, _atypes.QUInt8, _atypes.Resource, _atypes.String, _atypes.UInt16, _atypes.UInt32, _atypes.UInt4, _atypes.UInt64, _atypes.UInt8, _atypes.Variant)
|
| 26 |
+
|
| 27 |
+
@_dispatch.add_fallback_dispatch_list
|
| 28 |
+
@_dispatch.add_type_based_api_dispatcher
|
| 29 |
+
@tf_export('xla_cluster_output')
|
| 30 |
+
def xla_cluster_output(input: Annotated[Any, TV_XlaClusterOutput_T], name=None) -> Annotated[Any, TV_XlaClusterOutput_T]:
|
| 31 |
+
r"""Operator that connects the output of an XLA computation to other consumer graph nodes.
|
| 32 |
+
|
| 33 |
+
Args:
|
| 34 |
+
input: A `Tensor`.
|
| 35 |
+
name: A name for the operation (optional).
|
| 36 |
+
|
| 37 |
+
Returns:
|
| 38 |
+
A `Tensor`. Has the same type as `input`.
|
| 39 |
+
"""
|
| 40 |
+
_ctx = _context._context or _context.context()
|
| 41 |
+
tld = _ctx._thread_local_data
|
| 42 |
+
if tld.is_eager:
|
| 43 |
+
try:
|
| 44 |
+
_result = pywrap_tfe.TFE_Py_FastPathExecute(
|
| 45 |
+
_ctx, "XlaClusterOutput", name, input)
|
| 46 |
+
return _result
|
| 47 |
+
except _core._NotOkStatusException as e:
|
| 48 |
+
_ops.raise_from_not_ok_status(e, name)
|
| 49 |
+
except _core._FallbackException:
|
| 50 |
+
pass
|
| 51 |
+
try:
|
| 52 |
+
_result = _dispatcher_for_xla_cluster_output(
|
| 53 |
+
(input, name,), None)
|
| 54 |
+
if _result is not NotImplemented:
|
| 55 |
+
return _result
|
| 56 |
+
return xla_cluster_output_eager_fallback(
|
| 57 |
+
input, name=name, ctx=_ctx)
|
| 58 |
+
except _core._SymbolicException:
|
| 59 |
+
pass # Add nodes to the TensorFlow graph.
|
| 60 |
+
except (TypeError, ValueError):
|
| 61 |
+
_result = _dispatch.dispatch(
|
| 62 |
+
xla_cluster_output, (), dict(input=input, name=name)
|
| 63 |
+
)
|
| 64 |
+
if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED:
|
| 65 |
+
return _result
|
| 66 |
+
raise
|
| 67 |
+
else:
|
| 68 |
+
_result = _dispatcher_for_xla_cluster_output(
|
| 69 |
+
(input, name,), None)
|
| 70 |
+
if _result is not NotImplemented:
|
| 71 |
+
return _result
|
| 72 |
+
# Add nodes to the TensorFlow graph.
|
| 73 |
+
try:
|
| 74 |
+
_, _, _op, _outputs = _op_def_library._apply_op_helper(
|
| 75 |
+
"XlaClusterOutput", input=input, name=name)
|
| 76 |
+
except (TypeError, ValueError):
|
| 77 |
+
_result = _dispatch.dispatch(
|
| 78 |
+
xla_cluster_output, (), dict(input=input, name=name)
|
| 79 |
+
)
|
| 80 |
+
if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED:
|
| 81 |
+
return _result
|
| 82 |
+
raise
|
| 83 |
+
_result = _outputs[:]
|
| 84 |
+
if _execute.must_record_gradient():
|
| 85 |
+
_attrs = ("T", _op._get_attr_type("T"))
|
| 86 |
+
_inputs_flat = _op.inputs
|
| 87 |
+
_execute.record_gradient(
|
| 88 |
+
"XlaClusterOutput", _inputs_flat, _attrs, _result)
|
| 89 |
+
_result, = _result
|
| 90 |
+
return _result
|
| 91 |
+
|
| 92 |
+
XlaClusterOutput = tf_export("raw_ops.XlaClusterOutput")(_ops.to_raw_op(xla_cluster_output))
|
| 93 |
+
_dispatcher_for_xla_cluster_output = xla_cluster_output._tf_type_based_dispatcher.Dispatch
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
def xla_cluster_output_eager_fallback(input: Annotated[Any, TV_XlaClusterOutput_T], name, ctx) -> Annotated[Any, TV_XlaClusterOutput_T]:
|
| 97 |
+
_attr_T, (input,) = _execute.args_to_matching_eager([input], ctx, [])
|
| 98 |
+
_inputs_flat = [input]
|
| 99 |
+
_attrs = ("T", _attr_T)
|
| 100 |
+
_result = _execute.execute(b"XlaClusterOutput", 1, inputs=_inputs_flat,
|
| 101 |
+
attrs=_attrs, ctx=ctx, name=name)
|
| 102 |
+
if _execute.must_record_gradient():
|
| 103 |
+
_execute.record_gradient(
|
| 104 |
+
"XlaClusterOutput", _inputs_flat, _attrs, _result)
|
| 105 |
+
_result, = _result
|
| 106 |
+
return _result
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
@_dispatch.add_fallback_dispatch_list
|
| 110 |
+
@_dispatch.add_type_based_api_dispatcher
|
| 111 |
+
@tf_export('xla_launch')
|
| 112 |
+
def xla_launch(constants, args, resources: Annotated[List[Any], _atypes.Resource], Tresults, function, name=None):
|
| 113 |
+
r"""XLA Launch Op. For use by the XLA JIT only.
|
| 114 |
+
|
| 115 |
+
Args:
|
| 116 |
+
constants: A list of `Tensor` objects.
|
| 117 |
+
args: A list of `Tensor` objects.
|
| 118 |
+
resources: A list of `Tensor` objects with type `resource`.
|
| 119 |
+
Tresults: A list of `tf.DTypes`.
|
| 120 |
+
function: A function decorated with @Defun.
|
| 121 |
+
name: A name for the operation (optional).
|
| 122 |
+
|
| 123 |
+
Returns:
|
| 124 |
+
A list of `Tensor` objects of type `Tresults`.
|
| 125 |
+
"""
|
| 126 |
+
_ctx = _context._context or _context.context()
|
| 127 |
+
tld = _ctx._thread_local_data
|
| 128 |
+
if tld.is_eager:
|
| 129 |
+
try:
|
| 130 |
+
_result = pywrap_tfe.TFE_Py_FastPathExecute(
|
| 131 |
+
_ctx, "XlaLaunch", name, constants, args, resources, "Tresults",
|
| 132 |
+
Tresults, "function", function)
|
| 133 |
+
return _result
|
| 134 |
+
except _core._NotOkStatusException as e:
|
| 135 |
+
_ops.raise_from_not_ok_status(e, name)
|
| 136 |
+
except _core._FallbackException:
|
| 137 |
+
pass
|
| 138 |
+
try:
|
| 139 |
+
_result = _dispatcher_for_xla_launch(
|
| 140 |
+
(constants, args, resources, Tresults, function, name,), None)
|
| 141 |
+
if _result is not NotImplemented:
|
| 142 |
+
return _result
|
| 143 |
+
return xla_launch_eager_fallback(
|
| 144 |
+
constants, args, resources, Tresults=Tresults, function=function,
|
| 145 |
+
name=name, ctx=_ctx)
|
| 146 |
+
except _core._SymbolicException:
|
| 147 |
+
pass # Add nodes to the TensorFlow graph.
|
| 148 |
+
except (TypeError, ValueError):
|
| 149 |
+
_result = _dispatch.dispatch(
|
| 150 |
+
xla_launch, (), dict(constants=constants, args=args,
|
| 151 |
+
resources=resources, Tresults=Tresults,
|
| 152 |
+
function=function, name=name)
|
| 153 |
+
)
|
| 154 |
+
if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED:
|
| 155 |
+
return _result
|
| 156 |
+
raise
|
| 157 |
+
else:
|
| 158 |
+
_result = _dispatcher_for_xla_launch(
|
| 159 |
+
(constants, args, resources, Tresults, function, name,), None)
|
| 160 |
+
if _result is not NotImplemented:
|
| 161 |
+
return _result
|
| 162 |
+
# Add nodes to the TensorFlow graph.
|
| 163 |
+
if not isinstance(resources, (list, tuple)):
|
| 164 |
+
raise TypeError(
|
| 165 |
+
"Expected list for 'resources' argument to "
|
| 166 |
+
"'xla_launch' Op, not %r." % resources)
|
| 167 |
+
_attr_Nresources = len(resources)
|
| 168 |
+
if not isinstance(Tresults, (list, tuple)):
|
| 169 |
+
raise TypeError(
|
| 170 |
+
"Expected list for 'Tresults' argument to "
|
| 171 |
+
"'xla_launch' Op, not %r." % Tresults)
|
| 172 |
+
Tresults = [_execute.make_type(_t, "Tresults") for _t in Tresults]
|
| 173 |
+
try:
|
| 174 |
+
_, _, _op, _outputs = _op_def_library._apply_op_helper(
|
| 175 |
+
"XlaLaunch", constants=constants, args=args, resources=resources,
|
| 176 |
+
Tresults=Tresults, function=function, name=name)
|
| 177 |
+
except (TypeError, ValueError):
|
| 178 |
+
_result = _dispatch.dispatch(
|
| 179 |
+
xla_launch, (), dict(constants=constants, args=args,
|
| 180 |
+
resources=resources, Tresults=Tresults,
|
| 181 |
+
function=function, name=name)
|
| 182 |
+
)
|
| 183 |
+
if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED:
|
| 184 |
+
return _result
|
| 185 |
+
raise
|
| 186 |
+
_result = _outputs[:]
|
| 187 |
+
if not _result:
|
| 188 |
+
return _op
|
| 189 |
+
if _execute.must_record_gradient():
|
| 190 |
+
_attrs = ("Tconstants", _op.get_attr("Tconstants"), "Targs",
|
| 191 |
+
_op.get_attr("Targs"), "Nresources",
|
| 192 |
+
_op._get_attr_int("Nresources"), "Tresults",
|
| 193 |
+
_op.get_attr("Tresults"), "function", _op.get_attr("function"))
|
| 194 |
+
_inputs_flat = _op.inputs
|
| 195 |
+
_execute.record_gradient(
|
| 196 |
+
"XlaLaunch", _inputs_flat, _attrs, _result)
|
| 197 |
+
return _result
|
| 198 |
+
|
| 199 |
+
XlaLaunch = tf_export("raw_ops.XlaLaunch")(_ops.to_raw_op(xla_launch))
|
| 200 |
+
_dispatcher_for_xla_launch = xla_launch._tf_type_based_dispatcher.Dispatch
|
| 201 |
+
|
| 202 |
+
|
| 203 |
+
def xla_launch_eager_fallback(constants, args, resources: Annotated[List[Any], _atypes.Resource], Tresults, function, name, ctx):
|
| 204 |
+
if not isinstance(resources, (list, tuple)):
|
| 205 |
+
raise TypeError(
|
| 206 |
+
"Expected list for 'resources' argument to "
|
| 207 |
+
"'xla_launch' Op, not %r." % resources)
|
| 208 |
+
_attr_Nresources = len(resources)
|
| 209 |
+
if not isinstance(Tresults, (list, tuple)):
|
| 210 |
+
raise TypeError(
|
| 211 |
+
"Expected list for 'Tresults' argument to "
|
| 212 |
+
"'xla_launch' Op, not %r." % Tresults)
|
| 213 |
+
Tresults = [_execute.make_type(_t, "Tresults") for _t in Tresults]
|
| 214 |
+
_attr_Tconstants, constants = _execute.convert_to_mixed_eager_tensors(constants, ctx)
|
| 215 |
+
_attr_Targs, args = _execute.convert_to_mixed_eager_tensors(args, ctx)
|
| 216 |
+
resources = _ops.convert_n_to_tensor(resources, _dtypes.resource)
|
| 217 |
+
_inputs_flat = list(constants) + list(args) + list(resources)
|
| 218 |
+
_attrs = ("Tconstants", _attr_Tconstants, "Targs", _attr_Targs,
|
| 219 |
+
"Nresources", _attr_Nresources, "Tresults", Tresults, "function", function)
|
| 220 |
+
_result = _execute.execute(b"XlaLaunch", len(Tresults), inputs=_inputs_flat,
|
| 221 |
+
attrs=_attrs, ctx=ctx, name=name)
|
| 222 |
+
if _execute.must_record_gradient():
|
| 223 |
+
_execute.record_gradient(
|
| 224 |
+
"XlaLaunch", _inputs_flat, _attrs, _result)
|
| 225 |
+
return _result
|
| 226 |
+
|
| 227 |
+
|
| 228 |
+
@_dispatch.add_fallback_dispatch_list
|
| 229 |
+
@_dispatch.add_type_based_api_dispatcher
|
| 230 |
+
@tf_export('xla_launch_v2')
|
| 231 |
+
def xla_launch_v2(args, Tresults, constants, resources, function, name=None):
|
| 232 |
+
r"""XLA Launch Op. For use by the XLA JIT only.
|
| 233 |
+
|
| 234 |
+
Args:
|
| 235 |
+
args: A list of `Tensor` objects.
|
| 236 |
+
Tresults: A list of `tf.DTypes`.
|
| 237 |
+
constants: A list of `ints`.
|
| 238 |
+
resources: A list of `ints`.
|
| 239 |
+
function: A function decorated with @Defun.
|
| 240 |
+
name: A name for the operation (optional).
|
| 241 |
+
|
| 242 |
+
Returns:
|
| 243 |
+
A list of `Tensor` objects of type `Tresults`.
|
| 244 |
+
"""
|
| 245 |
+
_ctx = _context._context or _context.context()
|
| 246 |
+
tld = _ctx._thread_local_data
|
| 247 |
+
if tld.is_eager:
|
| 248 |
+
try:
|
| 249 |
+
_result = pywrap_tfe.TFE_Py_FastPathExecute(
|
| 250 |
+
_ctx, "XlaLaunchV2", name, args, "Tresults", Tresults, "constants",
|
| 251 |
+
constants, "resources", resources, "function", function)
|
| 252 |
+
return _result
|
| 253 |
+
except _core._NotOkStatusException as e:
|
| 254 |
+
_ops.raise_from_not_ok_status(e, name)
|
| 255 |
+
except _core._FallbackException:
|
| 256 |
+
pass
|
| 257 |
+
try:
|
| 258 |
+
_result = _dispatcher_for_xla_launch_v2(
|
| 259 |
+
(args, Tresults, constants, resources, function, name,), None)
|
| 260 |
+
if _result is not NotImplemented:
|
| 261 |
+
return _result
|
| 262 |
+
return xla_launch_v2_eager_fallback(
|
| 263 |
+
args, Tresults=Tresults, constants=constants, resources=resources,
|
| 264 |
+
function=function, name=name, ctx=_ctx)
|
| 265 |
+
except _core._SymbolicException:
|
| 266 |
+
pass # Add nodes to the TensorFlow graph.
|
| 267 |
+
except (TypeError, ValueError):
|
| 268 |
+
_result = _dispatch.dispatch(
|
| 269 |
+
xla_launch_v2, (), dict(args=args, Tresults=Tresults,
|
| 270 |
+
constants=constants, resources=resources,
|
| 271 |
+
function=function, name=name)
|
| 272 |
+
)
|
| 273 |
+
if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED:
|
| 274 |
+
return _result
|
| 275 |
+
raise
|
| 276 |
+
else:
|
| 277 |
+
_result = _dispatcher_for_xla_launch_v2(
|
| 278 |
+
(args, Tresults, constants, resources, function, name,), None)
|
| 279 |
+
if _result is not NotImplemented:
|
| 280 |
+
return _result
|
| 281 |
+
# Add nodes to the TensorFlow graph.
|
| 282 |
+
if not isinstance(Tresults, (list, tuple)):
|
| 283 |
+
raise TypeError(
|
| 284 |
+
"Expected list for 'Tresults' argument to "
|
| 285 |
+
"'xla_launch_v2' Op, not %r." % Tresults)
|
| 286 |
+
Tresults = [_execute.make_type(_t, "Tresults") for _t in Tresults]
|
| 287 |
+
if not isinstance(constants, (list, tuple)):
|
| 288 |
+
raise TypeError(
|
| 289 |
+
"Expected list for 'constants' argument to "
|
| 290 |
+
"'xla_launch_v2' Op, not %r." % constants)
|
| 291 |
+
constants = [_execute.make_int(_i, "constants") for _i in constants]
|
| 292 |
+
if not isinstance(resources, (list, tuple)):
|
| 293 |
+
raise TypeError(
|
| 294 |
+
"Expected list for 'resources' argument to "
|
| 295 |
+
"'xla_launch_v2' Op, not %r." % resources)
|
| 296 |
+
resources = [_execute.make_int(_i, "resources") for _i in resources]
|
| 297 |
+
try:
|
| 298 |
+
_, _, _op, _outputs = _op_def_library._apply_op_helper(
|
| 299 |
+
"XlaLaunchV2", args=args, Tresults=Tresults, constants=constants,
|
| 300 |
+
resources=resources, function=function, name=name)
|
| 301 |
+
except (TypeError, ValueError):
|
| 302 |
+
_result = _dispatch.dispatch(
|
| 303 |
+
xla_launch_v2, (), dict(args=args, Tresults=Tresults,
|
| 304 |
+
constants=constants, resources=resources,
|
| 305 |
+
function=function, name=name)
|
| 306 |
+
)
|
| 307 |
+
if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED:
|
| 308 |
+
return _result
|
| 309 |
+
raise
|
| 310 |
+
_result = _outputs[:]
|
| 311 |
+
if _execute.must_record_gradient():
|
| 312 |
+
_attrs = ("Targs", _op.get_attr("Targs"), "Tresults",
|
| 313 |
+
_op.get_attr("Tresults"), "constants",
|
| 314 |
+
_op.get_attr("constants"), "resources",
|
| 315 |
+
_op.get_attr("resources"), "function", _op.get_attr("function"))
|
| 316 |
+
_inputs_flat = _op.inputs
|
| 317 |
+
_execute.record_gradient(
|
| 318 |
+
"XlaLaunchV2", _inputs_flat, _attrs, _result)
|
| 319 |
+
return _result
|
| 320 |
+
|
| 321 |
+
XlaLaunchV2 = tf_export("raw_ops.XlaLaunchV2")(_ops.to_raw_op(xla_launch_v2))
|
| 322 |
+
_dispatcher_for_xla_launch_v2 = xla_launch_v2._tf_type_based_dispatcher.Dispatch
|
| 323 |
+
|
| 324 |
+
|
| 325 |
+
def xla_launch_v2_eager_fallback(args, Tresults, constants, resources, function, name, ctx):
|
| 326 |
+
if not isinstance(Tresults, (list, tuple)):
|
| 327 |
+
raise TypeError(
|
| 328 |
+
"Expected list for 'Tresults' argument to "
|
| 329 |
+
"'xla_launch_v2' Op, not %r." % Tresults)
|
| 330 |
+
Tresults = [_execute.make_type(_t, "Tresults") for _t in Tresults]
|
| 331 |
+
if not isinstance(constants, (list, tuple)):
|
| 332 |
+
raise TypeError(
|
| 333 |
+
"Expected list for 'constants' argument to "
|
| 334 |
+
"'xla_launch_v2' Op, not %r." % constants)
|
| 335 |
+
constants = [_execute.make_int(_i, "constants") for _i in constants]
|
| 336 |
+
if not isinstance(resources, (list, tuple)):
|
| 337 |
+
raise TypeError(
|
| 338 |
+
"Expected list for 'resources' argument to "
|
| 339 |
+
"'xla_launch_v2' Op, not %r." % resources)
|
| 340 |
+
resources = [_execute.make_int(_i, "resources") for _i in resources]
|
| 341 |
+
_attr_Targs, args = _execute.convert_to_mixed_eager_tensors(args, ctx)
|
| 342 |
+
_inputs_flat = list(args)
|
| 343 |
+
_attrs = ("Targs", _attr_Targs, "Tresults", Tresults, "constants",
|
| 344 |
+
constants, "resources", resources, "function", function)
|
| 345 |
+
_result = _execute.execute(b"XlaLaunchV2", len(Tresults),
|
| 346 |
+
inputs=_inputs_flat, attrs=_attrs, ctx=ctx,
|
| 347 |
+
name=name)
|
| 348 |
+
if _execute.must_record_gradient():
|
| 349 |
+
_execute.record_gradient(
|
| 350 |
+
"XlaLaunchV2", _inputs_flat, _attrs, _result)
|
| 351 |
+
return _result
|
| 352 |
+
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/xla_ops_grad.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Gradients for XLA ops."""
|
| 2 |
+
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
|
| 3 |
+
#
|
| 4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
# you may not use this file except in compliance with the License.
|
| 6 |
+
# You may obtain a copy of the License at
|
| 7 |
+
#
|
| 8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
#
|
| 10 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
# See the License for the specific language governing permissions and
|
| 14 |
+
# limitations under the License.
|
| 15 |
+
# ==============================================================================
|
| 16 |
+
|
| 17 |
+
from tensorflow.python.framework import ops
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
@ops.RegisterGradient("XlaClusterOutput")
|
| 21 |
+
def _XlaClusterOutputGrad(_, grad):
|
| 22 |
+
del grad # unused
|
| 23 |
+
raise RuntimeError("Gradient computation of graph in xla.compile() is "
|
| 24 |
+
"prohibited because it can cause performance degradation."
|
| 25 |
+
"Please move gradient computation inside xla.compile().")
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/__init__.py
ADDED
|
File without changes
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (231 Bytes). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/__pycache__/py_function_lib.cpython-310.pyc
ADDED
|
Binary file (22.2 kB). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/__pycache__/quantize_model.cpython-310.pyc
ADDED
|
Binary file (23 kB). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/__pycache__/representative_dataset.cpython-310.pyc
ADDED
|
Binary file (12.7 kB). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/__pycache__/save_model.cpython-310.pyc
ADDED
|
Binary file (9.72 kB). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/py_function_lib.py
ADDED
|
@@ -0,0 +1,770 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2023 The TensorFlow Authors. All Rights Reserved.
|
| 2 |
+
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
+
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
# ==============================================================================
|
| 15 |
+
"""Defines a wrapper class for overridden python method definitions."""
|
| 16 |
+
|
| 17 |
+
from collections.abc import Callable, Collection, Mapping, Sequence
|
| 18 |
+
import functools
|
| 19 |
+
import traceback
|
| 20 |
+
from typing import Optional, TypeVar
|
| 21 |
+
|
| 22 |
+
from absl import logging
|
| 23 |
+
|
| 24 |
+
from tensorflow.compiler.mlir.quantization.stablehlo import quantization_config_pb2 as stablehlo_quant_config_pb2
|
| 25 |
+
from tensorflow.compiler.mlir.quantization.tensorflow import exported_model_pb2
|
| 26 |
+
from tensorflow.compiler.mlir.quantization.tensorflow import quantization_options_pb2
|
| 27 |
+
from tensorflow.compiler.mlir.quantization.tensorflow.calibrator import calibration_algorithm
|
| 28 |
+
from tensorflow.compiler.mlir.quantization.tensorflow.calibrator import calibration_statistics_pb2
|
| 29 |
+
from tensorflow.compiler.mlir.quantization.tensorflow.python import pywrap_function_lib
|
| 30 |
+
from tensorflow.compiler.mlir.quantization.tensorflow.python import representative_dataset as rd
|
| 31 |
+
from tensorflow.compiler.mlir.quantization.tensorflow.python import save_model
|
| 32 |
+
from tensorflow.core.protobuf import meta_graph_pb2
|
| 33 |
+
from tensorflow.core.protobuf import saver_pb2
|
| 34 |
+
from tensorflow.python.client import session
|
| 35 |
+
from tensorflow.python.eager import context
|
| 36 |
+
from tensorflow.python.eager import wrap_function
|
| 37 |
+
from tensorflow.python.framework import ops
|
| 38 |
+
from tensorflow.python.framework import tensor_conversion
|
| 39 |
+
from tensorflow.python.lib.io import file_io
|
| 40 |
+
from tensorflow.python.saved_model import load
|
| 41 |
+
from tensorflow.python.saved_model import loader_impl
|
| 42 |
+
from tensorflow.python.trackable import autotrackable
|
| 43 |
+
from tensorflow.python.types import core
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
# Name of the saved model assets directory.
|
| 47 |
+
_ASSETS_DIR = 'assets'
|
| 48 |
+
_ASSETS_EXTRA_DIR = 'assets.extra'
|
| 49 |
+
|
| 50 |
+
# Type variable for a type that is not `None`. This represents a return value of
|
| 51 |
+
# methods in `PyFunctionLibrary` that should not be `None`, as `None` represents
|
| 52 |
+
# that the execution was unsucessful, transfored as `std::nullopt_t` from c++.
|
| 53 |
+
NotNoneT = TypeVar('NotNoneT')
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def _get_saver_def_or_none(
|
| 57 |
+
exported_model: exported_model_pb2.ExportedModel,
|
| 58 |
+
) -> Optional[saver_pb2.SaverDef]:
|
| 59 |
+
"""Returns the SaverDef from ExportedModel, None otherwise.
|
| 60 |
+
|
| 61 |
+
Args:
|
| 62 |
+
exported_model: ExportedModel to take the SaverDef from.
|
| 63 |
+
|
| 64 |
+
Returns:
|
| 65 |
+
SaverDef instance if the field `saver_def` is set. None otherwise.
|
| 66 |
+
"""
|
| 67 |
+
if exported_model.HasField('saver_def'):
|
| 68 |
+
return exported_model.saver_def
|
| 69 |
+
return None
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
def _copy_assets(src_path: str, dst_path: str) -> None:
|
| 73 |
+
"""Copies the assets directory of the saved model.
|
| 74 |
+
|
| 75 |
+
Clones the contents of the assets/ directory from the source saved model
|
| 76 |
+
directory to the destination saved model directory. Nothing will be copied if
|
| 77 |
+
there are no assets directory in the source directory.
|
| 78 |
+
|
| 79 |
+
Args:
|
| 80 |
+
src_path: Source saved model directory.
|
| 81 |
+
dst_path: Destination saved model directory. This directory must exist.
|
| 82 |
+
"""
|
| 83 |
+
for assets_dir_name in [_ASSETS_DIR, _ASSETS_EXTRA_DIR]:
|
| 84 |
+
src_assets_path = file_io.join(src_path, assets_dir_name)
|
| 85 |
+
if not file_io.file_exists_v2(src_assets_path):
|
| 86 |
+
# Do nothing if the source assets path does not exist.
|
| 87 |
+
continue
|
| 88 |
+
|
| 89 |
+
dst_assets_path = file_io.join(dst_path, assets_dir_name)
|
| 90 |
+
file_io.create_dir_v2(dst_assets_path)
|
| 91 |
+
|
| 92 |
+
for curr_dir, _, files in file_io.walk_v2(src_assets_path):
|
| 93 |
+
for asset_file_name in files:
|
| 94 |
+
src_asset_file = file_io.join(curr_dir, asset_file_name)
|
| 95 |
+
|
| 96 |
+
# Construct the destination assets file path.
|
| 97 |
+
curr_dst_dir = curr_dir.replace(src_assets_path, dst_assets_path)
|
| 98 |
+
dst_asset_file = file_io.join(curr_dst_dir, asset_file_name)
|
| 99 |
+
|
| 100 |
+
file_io.copy_v2(src_asset_file, dst_asset_file)
|
| 101 |
+
logging.info(
|
| 102 |
+
'Copied asset file: %s -> %s', src_asset_file, dst_asset_file
|
| 103 |
+
)
|
| 104 |
+
|
| 105 |
+
|
| 106 |
+
def _validate_representative_dataset(
|
| 107 |
+
representative_dataset: rd.RepresentativeDatasetOrMapping,
|
| 108 |
+
signature_keys: Collection[str],
|
| 109 |
+
) -> None:
|
| 110 |
+
"""Validates the representative dataset, based on the signature keys.
|
| 111 |
+
|
| 112 |
+
Representative dataset can be provided in two different forms: a single
|
| 113 |
+
instance of `RepresentativeDataset` or a map of signature key to the
|
| 114 |
+
corresponding `RepresentativeDataset`. These have a relationship with
|
| 115 |
+
`signature_keys`.
|
| 116 |
+
|
| 117 |
+
This function validates the following conditions:
|
| 118 |
+
* If `len(signature_keys) > 1`, then `representative_dataset` should be a
|
| 119 |
+
mapping where the keys exactly match the elements in `signature_keys`.
|
| 120 |
+
* If `len(signature_keys) == 1`, then both a mapping and a single instance of
|
| 121 |
+
`RepresentativeDataset` are allowed.
|
| 122 |
+
* This function also assumes `len(signature_keys) > 0`.
|
| 123 |
+
|
| 124 |
+
Args:
|
| 125 |
+
representative_dataset: A `RepresentativeDataset` or a map of string to
|
| 126 |
+
`RepresentativeDataset` to be validated.
|
| 127 |
+
signature_keys: A collection of strings that contains the signature keys,
|
| 128 |
+
each identifying a `SignatureDef`.
|
| 129 |
+
|
| 130 |
+
Raises:
|
| 131 |
+
ValueError: Iff `representative_dataset` does not satisfy the conditions
|
| 132 |
+
above.
|
| 133 |
+
"""
|
| 134 |
+
if isinstance(representative_dataset, Mapping):
|
| 135 |
+
if set(signature_keys) != set(representative_dataset.keys()):
|
| 136 |
+
raise ValueError(
|
| 137 |
+
'The signature keys and the keys of representative dataset map '
|
| 138 |
+
f'do not match. Signature keys: {set(signature_keys)}, '
|
| 139 |
+
f'representative dataset map: {set(representative_dataset.keys())}.'
|
| 140 |
+
)
|
| 141 |
+
else:
|
| 142 |
+
if len(signature_keys) > 1:
|
| 143 |
+
raise ValueError(
|
| 144 |
+
'Representative dataset is not a mapping '
|
| 145 |
+
f'(got: {type(representative_dataset)}), '
|
| 146 |
+
'but there is more than one signature key provided. '
|
| 147 |
+
'Please provide a map of {signature_key -> dataset} '
|
| 148 |
+
'with more than one signature key.'
|
| 149 |
+
)
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
def _replace_tensors_by_numpy_ndarrays(
|
| 153 |
+
repr_ds_map: rd.RepresentativeDatasetMapping,
|
| 154 |
+
) -> None:
|
| 155 |
+
"""Replaces tf.Tensors by their evaluated numpy arrays.
|
| 156 |
+
|
| 157 |
+
This assumes that tf.Tensors in representative samples are created in the
|
| 158 |
+
default Graph. It will raise an error if tensors are created in a different
|
| 159 |
+
graph.
|
| 160 |
+
|
| 161 |
+
Args:
|
| 162 |
+
repr_ds_map: SignatureDef key -> RepresentativeDataset mapping.
|
| 163 |
+
"""
|
| 164 |
+
with session.Session() as sess:
|
| 165 |
+
for signature_def_key in repr_ds_map:
|
| 166 |
+
# Replaces the dataset with a new dataset where tf.Tensors are replaced
|
| 167 |
+
# by their evaluated values.
|
| 168 |
+
ds = repr_ds_map[signature_def_key]
|
| 169 |
+
repr_ds_map[signature_def_key] = rd.replace_tensors_by_numpy_ndarrays(
|
| 170 |
+
ds, sess
|
| 171 |
+
)
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
def _create_sample_validator(
|
| 175 |
+
expected_input_keys: Collection[str],
|
| 176 |
+
) -> Callable[[rd.RepresentativeSample], rd.RepresentativeSample]:
|
| 177 |
+
"""Creates a validator function for a representative sample.
|
| 178 |
+
|
| 179 |
+
Args:
|
| 180 |
+
expected_input_keys: Input keys (keyword argument names) that the function
|
| 181 |
+
the sample will be used for is expecting to receive.
|
| 182 |
+
|
| 183 |
+
Returns:
|
| 184 |
+
A callable that validates a `RepresentativeSample`.
|
| 185 |
+
"""
|
| 186 |
+
|
| 187 |
+
def validator(
|
| 188 |
+
sample: rd.RepresentativeSample,
|
| 189 |
+
) -> rd.RepresentativeSample:
|
| 190 |
+
"""Validates a single instance of representative sample.
|
| 191 |
+
|
| 192 |
+
This provides a simple check for `sample` that this is a mapping of
|
| 193 |
+
{input_key: input_value}.
|
| 194 |
+
|
| 195 |
+
Args:
|
| 196 |
+
sample: A `RepresentativeSample` to validate.
|
| 197 |
+
|
| 198 |
+
Returns:
|
| 199 |
+
`sample` iff it is valid.
|
| 200 |
+
|
| 201 |
+
Raises:
|
| 202 |
+
ValueError: iff the sample isn't an instance of `Mapping`.
|
| 203 |
+
KeyError: iff the sample does not have the set of input keys that match
|
| 204 |
+
the input keys of the function.
|
| 205 |
+
"""
|
| 206 |
+
if not isinstance(sample, Mapping):
|
| 207 |
+
raise ValueError(
|
| 208 |
+
'Invalid representative sample type. Provide a mapping '
|
| 209 |
+
'(usually a dict) of {input_key: input_value}. '
|
| 210 |
+
f'Got type: {type(sample)} instead.'
|
| 211 |
+
)
|
| 212 |
+
|
| 213 |
+
if set(sample.keys()) != expected_input_keys:
|
| 214 |
+
raise KeyError(
|
| 215 |
+
'Invalid input keys for representative sample. The function expects '
|
| 216 |
+
f'input keys of: {set(expected_input_keys)}. '
|
| 217 |
+
f'Got: {set(sample.keys())}. Please provide correct input keys for '
|
| 218 |
+
'representative samples.'
|
| 219 |
+
)
|
| 220 |
+
|
| 221 |
+
return sample
|
| 222 |
+
|
| 223 |
+
return validator
|
| 224 |
+
|
| 225 |
+
|
| 226 |
+
# TODO(b/249918070): Implement a progress bar.
|
| 227 |
+
def _log_sample_num_for_calibration(
|
| 228 |
+
representative_dataset: rd.RepresentativeDataset,
|
| 229 |
+
) -> rd.RepresentativeDataset:
|
| 230 |
+
"""Logs the sample number for calibration.
|
| 231 |
+
|
| 232 |
+
If in debug logging level, the "sample number / total num samples" is logged
|
| 233 |
+
for every 5 iterations.
|
| 234 |
+
|
| 235 |
+
This is often useful when tracking the progress of the calibration step which
|
| 236 |
+
is often slow and may look stale if there's no logs being printed.
|
| 237 |
+
|
| 238 |
+
Args:
|
| 239 |
+
representative_dataset: The representative dataset.
|
| 240 |
+
|
| 241 |
+
Yields:
|
| 242 |
+
The representative samples from `representative_dataset` without any
|
| 243 |
+
modification.
|
| 244 |
+
"""
|
| 245 |
+
num_samples: Optional[int] = rd.get_num_samples(representative_dataset)
|
| 246 |
+
if num_samples is None:
|
| 247 |
+
total_num_samples = '?'
|
| 248 |
+
logging.info('Representative dataset size unknown.')
|
| 249 |
+
else:
|
| 250 |
+
total_num_samples = str(num_samples)
|
| 251 |
+
logging.info('Using representative dataset of size: %s', total_num_samples)
|
| 252 |
+
|
| 253 |
+
sample_num = 0
|
| 254 |
+
for sample in representative_dataset:
|
| 255 |
+
sample_num += 1
|
| 256 |
+
|
| 257 |
+
# Log the sample number for every 5 iterations.
|
| 258 |
+
logging.log_every_n(
|
| 259 |
+
logging.DEBUG,
|
| 260 |
+
'Running representative sample for calibration: %d / %s',
|
| 261 |
+
5,
|
| 262 |
+
sample_num,
|
| 263 |
+
total_num_samples,
|
| 264 |
+
)
|
| 265 |
+
yield sample
|
| 266 |
+
|
| 267 |
+
logging.info(
|
| 268 |
+
'Running representative samples complete: %d / %s',
|
| 269 |
+
sample_num,
|
| 270 |
+
total_num_samples,
|
| 271 |
+
)
|
| 272 |
+
|
| 273 |
+
|
| 274 |
+
def _run_function_for_calibration_graph_mode(
|
| 275 |
+
sess: session.Session,
|
| 276 |
+
signature_def: meta_graph_pb2.SignatureDef,
|
| 277 |
+
representative_dataset: rd.RepresentativeDataset,
|
| 278 |
+
) -> None:
|
| 279 |
+
"""Runs the representative dataset through a function for calibration.
|
| 280 |
+
|
| 281 |
+
NOTE: This is intended to be run in graph mode (TF1).
|
| 282 |
+
|
| 283 |
+
The function is identified by the SignatureDef.
|
| 284 |
+
|
| 285 |
+
Args:
|
| 286 |
+
sess: The Session object to run the function in.
|
| 287 |
+
signature_def: A SignatureDef that identifies a function by specifying the
|
| 288 |
+
inputs and outputs.
|
| 289 |
+
representative_dataset: The representative dataset to run through the
|
| 290 |
+
function.
|
| 291 |
+
"""
|
| 292 |
+
output_tensor_names = [
|
| 293 |
+
output_tensor_info.name
|
| 294 |
+
for output_tensor_info in signature_def.outputs.values()
|
| 295 |
+
]
|
| 296 |
+
|
| 297 |
+
sample_validator = _create_sample_validator(
|
| 298 |
+
expected_input_keys=signature_def.inputs.keys()
|
| 299 |
+
)
|
| 300 |
+
|
| 301 |
+
for sample in map(
|
| 302 |
+
sample_validator, _log_sample_num_for_calibration(representative_dataset)
|
| 303 |
+
):
|
| 304 |
+
# Create a mapping from input tensor name to the input tensor value.
|
| 305 |
+
# ex) "Placeholder:0" -> [0, 1, 2]
|
| 306 |
+
feed_dict = rd.create_feed_dict_from_input_data(sample, signature_def)
|
| 307 |
+
sess.run(output_tensor_names, feed_dict=feed_dict)
|
| 308 |
+
|
| 309 |
+
|
| 310 |
+
def _run_graph_for_calibration_graph_mode(
|
| 311 |
+
model_dir: str,
|
| 312 |
+
tags: Collection[str],
|
| 313 |
+
representative_dataset_map: rd.RepresentativeDatasetMapping,
|
| 314 |
+
) -> None:
|
| 315 |
+
"""Runs the graph for calibration in graph mode.
|
| 316 |
+
|
| 317 |
+
This function assumes _graph mode_ (used when legacy TF1 is used or when eager
|
| 318 |
+
mode is explicitly disabled) when running the graph. This step is used in
|
| 319 |
+
order to collect the statistics in CustomAggregatorOp for quantization using
|
| 320 |
+
the representative dataset for the actual data provided for inference.
|
| 321 |
+
|
| 322 |
+
Args:
|
| 323 |
+
model_dir: Path to SavedModel directory.
|
| 324 |
+
tags: Collection of tags identifying the MetaGraphDef within the SavedModel.
|
| 325 |
+
representative_dataset_map: A map where signature keys are mapped to
|
| 326 |
+
corresponding representative datasets.
|
| 327 |
+
|
| 328 |
+
Raises:
|
| 329 |
+
ValueError: When running the function with the representative dataset fails.
|
| 330 |
+
"""
|
| 331 |
+
# Replace tf.Tensors by numpy ndarrays in order to reuse the samples in a
|
| 332 |
+
# different graph when running the calibration.
|
| 333 |
+
_replace_tensors_by_numpy_ndarrays(representative_dataset_map)
|
| 334 |
+
|
| 335 |
+
# Run the calibration in a new graph to avoid name collision, which could
|
| 336 |
+
# happen when the same model is loaded multiple times in the default graph.
|
| 337 |
+
with ops.Graph().as_default(), session.Session() as sess:
|
| 338 |
+
meta_graph: meta_graph_pb2.MetaGraphDef = loader_impl.load(
|
| 339 |
+
sess, tags, export_dir=model_dir
|
| 340 |
+
)
|
| 341 |
+
|
| 342 |
+
for signature_key, repr_ds in representative_dataset_map.items():
|
| 343 |
+
sig_def = meta_graph.signature_def[signature_key]
|
| 344 |
+
|
| 345 |
+
try:
|
| 346 |
+
_run_function_for_calibration_graph_mode(
|
| 347 |
+
sess, signature_def=sig_def, representative_dataset=repr_ds
|
| 348 |
+
)
|
| 349 |
+
except Exception as ex:
|
| 350 |
+
raise ValueError(
|
| 351 |
+
'Failed to run representative dataset through the '
|
| 352 |
+
f'function with the signature key: {signature_key}.'
|
| 353 |
+
) from ex
|
| 354 |
+
|
| 355 |
+
|
| 356 |
+
def _convert_values_to_tf_tensors(
|
| 357 |
+
sample: rd.RepresentativeSample,
|
| 358 |
+
) -> Mapping[str, core.Tensor]:
|
| 359 |
+
"""Converts TensorLike values of `sample` to Tensors.
|
| 360 |
+
|
| 361 |
+
Creates a copy of `sample`, where each value is converted to Tensors
|
| 362 |
+
unless it is already a Tensor.
|
| 363 |
+
The values are not converted in-place (i.e. `sample` is not mutated).
|
| 364 |
+
|
| 365 |
+
Args:
|
| 366 |
+
sample: A representative sample, which is a map of {name -> tensorlike
|
| 367 |
+
value}.
|
| 368 |
+
|
| 369 |
+
Returns:
|
| 370 |
+
Converted map of {name -> tensor}.
|
| 371 |
+
"""
|
| 372 |
+
tensor_mapping = {}
|
| 373 |
+
for name, tensorlike_value in sample.items():
|
| 374 |
+
if isinstance(tensorlike_value, core.Tensor):
|
| 375 |
+
tensor_value = tensorlike_value
|
| 376 |
+
else:
|
| 377 |
+
tensor_value = tensor_conversion.convert_to_tensor_v2_with_dispatch(
|
| 378 |
+
tensorlike_value
|
| 379 |
+
)
|
| 380 |
+
|
| 381 |
+
tensor_mapping[name] = tensor_value
|
| 382 |
+
|
| 383 |
+
return tensor_mapping
|
| 384 |
+
|
| 385 |
+
|
| 386 |
+
def _run_function_for_calibration_eager_mode(
|
| 387 |
+
func: wrap_function.WrappedFunction,
|
| 388 |
+
representative_dataset: rd.RepresentativeDataset,
|
| 389 |
+
) -> None:
|
| 390 |
+
"""Runs the representative dataset through a function for calibration.
|
| 391 |
+
|
| 392 |
+
NOTE: This is intended to be run in eager mode (TF2).
|
| 393 |
+
|
| 394 |
+
Args:
|
| 395 |
+
func: The function to run the representative samples through.
|
| 396 |
+
representative_dataset: Representative dataset used for calibration. The
|
| 397 |
+
input keys and input values of the representative samples should match the
|
| 398 |
+
keyword arguments of `func`.
|
| 399 |
+
"""
|
| 400 |
+
_, keyword_args = func.structured_input_signature
|
| 401 |
+
sample_validator = _create_sample_validator(
|
| 402 |
+
expected_input_keys=keyword_args.keys()
|
| 403 |
+
)
|
| 404 |
+
|
| 405 |
+
for sample in map(
|
| 406 |
+
sample_validator, _log_sample_num_for_calibration(representative_dataset)
|
| 407 |
+
):
|
| 408 |
+
# Convert any non-Tensor values from the sample to Tensors.
|
| 409 |
+
# This conversion is required because the model saved in `model_dir` is
|
| 410 |
+
# saved using TF1 SavedModelBuilder, which doesn't save the
|
| 411 |
+
# SavedObjectGraph.
|
| 412 |
+
func_kwargs = _convert_values_to_tf_tensors(sample)
|
| 413 |
+
func(**func_kwargs)
|
| 414 |
+
|
| 415 |
+
|
| 416 |
+
def _run_graph_for_calibration_eager_mode(
|
| 417 |
+
model_dir: str,
|
| 418 |
+
tags: Collection[str],
|
| 419 |
+
representative_dataset_map: rd.RepresentativeDatasetMapping,
|
| 420 |
+
) -> None:
|
| 421 |
+
"""Runs the graph for calibration in eager mode.
|
| 422 |
+
|
| 423 |
+
This function assumes _eager mode_ (enabled in TF2 by default) when running
|
| 424 |
+
the graph. This step is used in order to collect the statistics in
|
| 425 |
+
CustomAggregatorOp for quantization using the representative dataset for the
|
| 426 |
+
actual data provided for inference.
|
| 427 |
+
|
| 428 |
+
Args:
|
| 429 |
+
model_dir: Path to SavedModel directory.
|
| 430 |
+
tags: Collection of tags identifying the MetaGraphDef within the SavedModel.
|
| 431 |
+
representative_dataset_map: A map where signature keys are mapped to
|
| 432 |
+
corresponding representative datasets.
|
| 433 |
+
|
| 434 |
+
Raises:
|
| 435 |
+
ValueError: When running the function with the representative dataset fails.
|
| 436 |
+
"""
|
| 437 |
+
root: autotrackable.AutoTrackable = load.load(model_dir, tags)
|
| 438 |
+
for signature_key, repr_ds in representative_dataset_map.items():
|
| 439 |
+
try:
|
| 440 |
+
_run_function_for_calibration_eager_mode(
|
| 441 |
+
func=root.signatures[signature_key], representative_dataset=repr_ds
|
| 442 |
+
)
|
| 443 |
+
except Exception as ex:
|
| 444 |
+
raise ValueError(
|
| 445 |
+
'Failed to run representative dataset through the '
|
| 446 |
+
f'function with the signature key: {signature_key}.'
|
| 447 |
+
) from ex
|
| 448 |
+
|
| 449 |
+
|
| 450 |
+
def _run_graph_for_calibration(
|
| 451 |
+
float_model_dir: str,
|
| 452 |
+
signature_keys: Sequence[str],
|
| 453 |
+
tags: Collection[str],
|
| 454 |
+
representative_dataset: rd.RepresentativeDatasetOrMapping,
|
| 455 |
+
force_graph_mode_calibration: bool,
|
| 456 |
+
) -> None:
|
| 457 |
+
"""Runs the graph for calibration using representative datasets.
|
| 458 |
+
|
| 459 |
+
Args:
|
| 460 |
+
float_model_dir: Path to the model to calibrate.
|
| 461 |
+
signature_keys: Sequence of keys identifying SignatureDef containing inputs
|
| 462 |
+
and outputs.
|
| 463 |
+
tags: Collection of tags identifying the MetaGraphDef within the SavedModel
|
| 464 |
+
to analyze.
|
| 465 |
+
representative_dataset: An iterator that returns a dictionary of {input_key:
|
| 466 |
+
input_value} or a mapping from signature keys to such iterators. When
|
| 467 |
+
`signature_keys` contains more than one signature key,
|
| 468 |
+
`representative_datsaet` should be a mapping that maps each signature keys
|
| 469 |
+
to the corresponding representative dataset.
|
| 470 |
+
force_graph_mode_calibration: If set to true, it forces calibration in graph
|
| 471 |
+
model instead of eager mode when the context is in eager mode.
|
| 472 |
+
|
| 473 |
+
Raises:
|
| 474 |
+
ValueError iff:
|
| 475 |
+
* The representative dataset format is invalid.
|
| 476 |
+
* It fails to run the functions using the representative datasets.
|
| 477 |
+
"""
|
| 478 |
+
try:
|
| 479 |
+
_validate_representative_dataset(representative_dataset, signature_keys)
|
| 480 |
+
except Exception as ex:
|
| 481 |
+
raise ValueError('Invalid representative dataset.') from ex
|
| 482 |
+
|
| 483 |
+
# If `representative_dataset` is not a mapping, convert to a mapping for the
|
| 484 |
+
# following functions to handle representative datasets more conveniently.
|
| 485 |
+
representative_dataset_map = representative_dataset
|
| 486 |
+
if not isinstance(representative_dataset, Mapping):
|
| 487 |
+
# `signature_keys` is guaranteed to have only one element after the
|
| 488 |
+
# validation.
|
| 489 |
+
representative_dataset_map = {signature_keys[0]: representative_dataset}
|
| 490 |
+
|
| 491 |
+
try:
|
| 492 |
+
if context.executing_eagerly() and not force_graph_mode_calibration:
|
| 493 |
+
logging.info('Calibration step is executed in eager mode.')
|
| 494 |
+
_run_graph_for_calibration_eager_mode(
|
| 495 |
+
float_model_dir, tags, representative_dataset_map
|
| 496 |
+
)
|
| 497 |
+
else:
|
| 498 |
+
logging.info('Calibration step is executed in graph mode.')
|
| 499 |
+
_run_graph_for_calibration_graph_mode(
|
| 500 |
+
float_model_dir, tags, representative_dataset_map
|
| 501 |
+
)
|
| 502 |
+
except Exception as ex:
|
| 503 |
+
raise ValueError(
|
| 504 |
+
'Failed to run graph for post-training quantization calibration.'
|
| 505 |
+
) from ex
|
| 506 |
+
|
| 507 |
+
logging.info('Calibration step complete.')
|
| 508 |
+
|
| 509 |
+
|
| 510 |
+
def _run_calibration(
|
| 511 |
+
saved_model_path: str,
|
| 512 |
+
signature_keys: Sequence[str],
|
| 513 |
+
tags: Collection[str],
|
| 514 |
+
force_graph_mode_calibration: bool,
|
| 515 |
+
representative_dataset_file_map: Mapping[
|
| 516 |
+
str, quantization_options_pb2.RepresentativeDatasetFile
|
| 517 |
+
],
|
| 518 |
+
) -> bool:
|
| 519 |
+
"""Runs calibration and adds calibration statistics to exported model.
|
| 520 |
+
|
| 521 |
+
Args:
|
| 522 |
+
saved_model_path: Path to the SavedModel to run calibration.
|
| 523 |
+
signature_keys: List of signature keys corresponding to SignatureDefs to run
|
| 524 |
+
calibration on.
|
| 525 |
+
tags: A set of tags that identify the MetaGraphDef.
|
| 526 |
+
force_graph_mode_calibration: If True, runs the calibration in graph mode.
|
| 527 |
+
representative_dataset_file_map: Signature key ->
|
| 528 |
+
`RepresentativeDatasetFile` mapping for running the calibration step. Each
|
| 529 |
+
dataset file stores the representative dataset for the function matching
|
| 530 |
+
the signature key.
|
| 531 |
+
|
| 532 |
+
Returns:
|
| 533 |
+
`True` upon successfully running calibration.
|
| 534 |
+
"""
|
| 535 |
+
repr_dataset_map = rd.TfRecordRepresentativeDatasetLoader(
|
| 536 |
+
representative_dataset_file_map
|
| 537 |
+
).load()
|
| 538 |
+
|
| 539 |
+
# Uses the representative dataset to collect statistics for calibration.
|
| 540 |
+
# After this operation, min & max values are stored separately in a global
|
| 541 |
+
# CalibratorSingleton instance.
|
| 542 |
+
_run_graph_for_calibration(
|
| 543 |
+
saved_model_path,
|
| 544 |
+
signature_keys,
|
| 545 |
+
tags,
|
| 546 |
+
repr_dataset_map,
|
| 547 |
+
force_graph_mode_calibration,
|
| 548 |
+
)
|
| 549 |
+
|
| 550 |
+
# Dummy value to indicate successful run, as `None` would indicate error. See
|
| 551 |
+
# comments in `NotNoneT`.
|
| 552 |
+
return True
|
| 553 |
+
|
| 554 |
+
|
| 555 |
+
def _call_and_return_none_on_error(
|
| 556 |
+
func: Callable[[], NotNoneT], error_msg: str
|
| 557 |
+
) -> Optional[NotNoneT]:
|
| 558 |
+
"""Calls `func` and returns `None` on error.
|
| 559 |
+
|
| 560 |
+
This is used to gracefully return the 'error status' represented as `None`, as
|
| 561 |
+
raising exceptions from `PyFunctionLibrary` methods crashes the program.
|
| 562 |
+
|
| 563 |
+
Args:
|
| 564 |
+
func: The function to run. The function should be a callable returning a
|
| 565 |
+
non-None value.
|
| 566 |
+
error_msg: The error message to log upon error. Used for debugging purposes.
|
| 567 |
+
|
| 568 |
+
Returns:
|
| 569 |
+
`None` if the function raises an exception. The return value of `func`
|
| 570 |
+
otherwise.
|
| 571 |
+
"""
|
| 572 |
+
try:
|
| 573 |
+
return func()
|
| 574 |
+
except Exception as ex: # pylint: disable=broad-exception-caught; Required for graceful failing with pybind11.
|
| 575 |
+
# Prints the exception traceback for debuggability.
|
| 576 |
+
traceback.print_exception(ex)
|
| 577 |
+
# Additional error log for debuggability.
|
| 578 |
+
logging.error(error_msg)
|
| 579 |
+
return None
|
| 580 |
+
|
| 581 |
+
|
| 582 |
+
def _save_model_and_copy_assets(
|
| 583 |
+
exported_model: exported_model_pb2.ExportedModel,
|
| 584 |
+
src_saved_model_path: str,
|
| 585 |
+
dst_saved_model_path: str,
|
| 586 |
+
signature_def_map: Mapping[str, meta_graph_pb2.SignatureDef],
|
| 587 |
+
tags: Collection[str],
|
| 588 |
+
) -> bool:
|
| 589 |
+
"""Saves the model and copies the assets from the source model.
|
| 590 |
+
|
| 591 |
+
Args:
|
| 592 |
+
exported_model: ExportedModel to save.
|
| 593 |
+
src_saved_model_path: Path to the source SavedModel. This will be used to
|
| 594 |
+
copy the asset files to `dst_saved_model_path`.
|
| 595 |
+
dst_saved_model_path: Destination path to save the exported model.
|
| 596 |
+
signature_def_map: Signature key -> SignatureDef mapping.
|
| 597 |
+
tags: Tags to attach to the saved MetaGraphDef.
|
| 598 |
+
|
| 599 |
+
Returns:
|
| 600 |
+
`True` upon successfully saving the model.
|
| 601 |
+
"""
|
| 602 |
+
save_model.save_model_v1(
|
| 603 |
+
exported_model.graph_def,
|
| 604 |
+
dst_saved_model_path,
|
| 605 |
+
signature_def_map,
|
| 606 |
+
tags,
|
| 607 |
+
init_op_name=exported_model.init_node_name,
|
| 608 |
+
saver_def=_get_saver_def_or_none(exported_model),
|
| 609 |
+
checkpoint_dir=exported_model.checkpoint_dir,
|
| 610 |
+
function_aliases=exported_model.function_aliases,
|
| 611 |
+
asset_file_defs=exported_model.asset_file_defs,
|
| 612 |
+
)
|
| 613 |
+
|
| 614 |
+
_copy_assets(src_saved_model_path, dst_saved_model_path)
|
| 615 |
+
|
| 616 |
+
# Dummy value to indicate successful run, as `None` would indicate error. See
|
| 617 |
+
# comments in `NotNoneT`.
|
| 618 |
+
return True
|
| 619 |
+
|
| 620 |
+
|
| 621 |
+
class PyFunctionLibrary(pywrap_function_lib.PyFunctionLibrary):
|
| 622 |
+
"""Wrapper class for overridden python method definitions.
|
| 623 |
+
|
| 624 |
+
This class contains python methods that overrides C++ virtual functions
|
| 625 |
+
declared in `pywrap_function_lib.PyFunctionLibrary`.
|
| 626 |
+
"""
|
| 627 |
+
|
| 628 |
+
# LINT.IfChange(save_exported_model)
|
| 629 |
+
def save_exported_model(
|
| 630 |
+
self,
|
| 631 |
+
dst_saved_model_path: str,
|
| 632 |
+
exported_model_serialized: bytes,
|
| 633 |
+
src_saved_model_path: str,
|
| 634 |
+
tags: set[str],
|
| 635 |
+
serialized_signature_def_map: dict[str, bytes],
|
| 636 |
+
) -> Optional[bool]:
|
| 637 |
+
# LINT.ThenChange(py_function_lib.h:save_exported_model)
|
| 638 |
+
"""Saves `ExportedModel` to `dst_saved_model_path` as a SavedModel.
|
| 639 |
+
|
| 640 |
+
Args:
|
| 641 |
+
dst_saved_model_path: Destination path to save the exported model.
|
| 642 |
+
exported_model_serialized: Exported model to export as SavedModel.
|
| 643 |
+
src_saved_model_path: Path to the source SavedModel. This will be used to
|
| 644 |
+
copy the asset files to `dst_saved_model_path`.
|
| 645 |
+
tags: Tags to attach to the saved MetaGraphDef.
|
| 646 |
+
serialized_signature_def_map: Signature key -> serialized SignatureDef.
|
| 647 |
+
|
| 648 |
+
Returns:
|
| 649 |
+
`True` upon successful execution. `None` when an error is raised
|
| 650 |
+
internally.
|
| 651 |
+
"""
|
| 652 |
+
exported_model = exported_model_pb2.ExportedModel.FromString(
|
| 653 |
+
exported_model_serialized
|
| 654 |
+
)
|
| 655 |
+
|
| 656 |
+
# Deserialize values in signature_def_map.
|
| 657 |
+
signature_def_map = {}
|
| 658 |
+
for key, serialized_signature_def in serialized_signature_def_map.items():
|
| 659 |
+
signature_def_map[key] = meta_graph_pb2.SignatureDef.FromString(
|
| 660 |
+
serialized_signature_def
|
| 661 |
+
)
|
| 662 |
+
|
| 663 |
+
return _call_and_return_none_on_error(
|
| 664 |
+
func=functools.partial(
|
| 665 |
+
_save_model_and_copy_assets,
|
| 666 |
+
exported_model,
|
| 667 |
+
src_saved_model_path,
|
| 668 |
+
dst_saved_model_path,
|
| 669 |
+
signature_def_map,
|
| 670 |
+
tags,
|
| 671 |
+
),
|
| 672 |
+
error_msg=(
|
| 673 |
+
f'Failed to save model "{dst_saved_model_path}",'
|
| 674 |
+
f' signature_def_map: {signature_def_map}, tags: {tags}.'
|
| 675 |
+
),
|
| 676 |
+
)
|
| 677 |
+
|
| 678 |
+
# TODO: b/311097139 - Extract calibration related functions into a separate
|
| 679 |
+
# file.
|
| 680 |
+
# LINT.IfChange(run_calibration)
|
| 681 |
+
def run_calibration(
|
| 682 |
+
self,
|
| 683 |
+
saved_model_path: str,
|
| 684 |
+
signature_keys: list[str],
|
| 685 |
+
tags: set[str],
|
| 686 |
+
force_graph_mode_calibration: bool,
|
| 687 |
+
representative_dataset_file_map_serialized: dict[str, bytes],
|
| 688 |
+
) -> Optional[bool]:
|
| 689 |
+
# LINT.ThenChange(py_function_lib.h:run_calibration)
|
| 690 |
+
"""Runs calibration and adds calibration statistics to exported model.
|
| 691 |
+
|
| 692 |
+
Args:
|
| 693 |
+
saved_model_path: Path to the SavedModel to run calibration.
|
| 694 |
+
signature_keys: List of signature keys corresponding to SignatureDefs to
|
| 695 |
+
run calibration on.
|
| 696 |
+
tags: A set of tags that identify the MetaGraphDef.
|
| 697 |
+
force_graph_mode_calibration: If True, runs the calibration in graph mode.
|
| 698 |
+
representative_dataset_file_map_serialized: Signature key ->
|
| 699 |
+
`RepresentativeDatasetFile` mapping for running the calibration step.
|
| 700 |
+
Each dataset file stores the representative dataset for the function
|
| 701 |
+
matching the signature key.
|
| 702 |
+
|
| 703 |
+
Returns:
|
| 704 |
+
The error message if the function raises and exception. `None` otherwise.
|
| 705 |
+
"""
|
| 706 |
+
# Deserialize `RepresentativeDatasetFile` values.
|
| 707 |
+
dataset_file_map = {}
|
| 708 |
+
for (
|
| 709 |
+
signature_key,
|
| 710 |
+
dataset_file_serialized,
|
| 711 |
+
) in representative_dataset_file_map_serialized.items():
|
| 712 |
+
dataset_file_map[signature_key] = (
|
| 713 |
+
quantization_options_pb2.RepresentativeDatasetFile.FromString(
|
| 714 |
+
dataset_file_serialized
|
| 715 |
+
)
|
| 716 |
+
)
|
| 717 |
+
|
| 718 |
+
return _call_and_return_none_on_error(
|
| 719 |
+
func=functools.partial(
|
| 720 |
+
_run_calibration,
|
| 721 |
+
saved_model_path,
|
| 722 |
+
signature_keys,
|
| 723 |
+
tags,
|
| 724 |
+
force_graph_mode_calibration,
|
| 725 |
+
dataset_file_map,
|
| 726 |
+
),
|
| 727 |
+
error_msg=(
|
| 728 |
+
f'Failed to run calibration on model "{saved_model_path}",'
|
| 729 |
+
f' signature_keys: {signature_keys}, tags: {tags}.'
|
| 730 |
+
),
|
| 731 |
+
)
|
| 732 |
+
|
| 733 |
+
# LINT.IfChange(get_calibration_min_max_value)
|
| 734 |
+
def get_calibration_min_max_value(
|
| 735 |
+
self,
|
| 736 |
+
calibration_statistics_serialized: bytes,
|
| 737 |
+
calibration_options_serialized: bytes,
|
| 738 |
+
) -> Optional[tuple[float, float]]:
|
| 739 |
+
"""Calculates min and max values from statistics.
|
| 740 |
+
|
| 741 |
+
Args:
|
| 742 |
+
calibration_statistics_serialized: Serialized `CalibrationStatistics`.
|
| 743 |
+
This will be the source to calculate min and max values from.
|
| 744 |
+
calibration_options_serialized: Serialized `CalibrationOptions`. Specifies
|
| 745 |
+
how the min / max should be calculated.
|
| 746 |
+
|
| 747 |
+
Returns:
|
| 748 |
+
(min_value, max_value): Min and max calculated using calib_opts. `None`
|
| 749 |
+
upon error.
|
| 750 |
+
"""
|
| 751 |
+
# LINT.ThenChange(py_function_lib.h:get_calibration_min_max_value)
|
| 752 |
+
|
| 753 |
+
# Deserialize values passed from c++.
|
| 754 |
+
statistics = calibration_statistics_pb2.CalibrationStatistics.FromString(
|
| 755 |
+
calibration_statistics_serialized
|
| 756 |
+
)
|
| 757 |
+
options = stablehlo_quant_config_pb2.CalibrationOptions.FromString(
|
| 758 |
+
calibration_options_serialized
|
| 759 |
+
)
|
| 760 |
+
|
| 761 |
+
return _call_and_return_none_on_error(
|
| 762 |
+
functools.partial(
|
| 763 |
+
calibration_algorithm.get_min_max_value,
|
| 764 |
+
statistics,
|
| 765 |
+
options,
|
| 766 |
+
),
|
| 767 |
+
error_msg=(
|
| 768 |
+
f'Retrieving calibrated min / max failed. Options: {options}.'
|
| 769 |
+
),
|
| 770 |
+
)
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/pywrap_function_lib.pyi
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2023 The TensorFlow Authors. All Rights Reserved.
|
| 2 |
+
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
+
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
# ==============================================================================
|
| 15 |
+
from typing import Any, Optional
|
| 16 |
+
|
| 17 |
+
class PyFunctionLibrary:
|
| 18 |
+
|
| 19 |
+
# LINT.IfChange(save_exported_model)
|
| 20 |
+
def save_exported_model(
|
| 21 |
+
self,
|
| 22 |
+
dst_saved_model_path: str,
|
| 23 |
+
exported_model_serialized: bytes,
|
| 24 |
+
src_saved_model_path: str,
|
| 25 |
+
tags: set[str],
|
| 26 |
+
serialized_signature_def_map: dict[str, bytes],
|
| 27 |
+
) -> Optional[bool]: ...
|
| 28 |
+
# LINT.ThenChange()
|
| 29 |
+
|
| 30 |
+
# LINT.IfChange(run_calibration)
|
| 31 |
+
def run_calibration(
|
| 32 |
+
self,
|
| 33 |
+
saved_model_path: str,
|
| 34 |
+
signature_keys: list[str],
|
| 35 |
+
tags: set[str],
|
| 36 |
+
force_graph_mode_calibration: bool,
|
| 37 |
+
# Value type: RepresentativeDatasetFile.
|
| 38 |
+
representative_dataset_file_map_serialized: dict[str, bytes],
|
| 39 |
+
) -> Optional[bool]: ...
|
| 40 |
+
# LINT.ThenChange()
|
| 41 |
+
|
| 42 |
+
# LINT.IfChange(get_calibration_min_max_value)
|
| 43 |
+
def get_calibration_min_max_value(
|
| 44 |
+
self,
|
| 45 |
+
calibration_statistics_serialized: bytes,
|
| 46 |
+
calibration_options_serialized: bytes,
|
| 47 |
+
) -> Optional[tuple[float, float]]: ...
|
| 48 |
+
# LINT.ThenChange()
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/pywrap_function_lib.so
ADDED
|
Binary file (321 kB). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/python/pywrap_quantize_model.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ce6434a9bb81081892f212ae21a81fc331353532280da8b44ff7f8640c61b273
|
| 3 |
+
size 2026097
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/tensorflow/__init__.py
ADDED
|
File without changes
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/tensorflow/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (211 Bytes). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/tensorflow/__pycache__/gen_mlir_passthrough_op.cpython-310.pyc
ADDED
|
Binary file (3.91 kB). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/mlir/tensorflow/gen_mlir_passthrough_op.py
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Python wrappers around TensorFlow ops.
|
| 2 |
+
|
| 3 |
+
This file is MACHINE GENERATED! Do not edit.
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
import collections
|
| 7 |
+
|
| 8 |
+
from tensorflow.python import pywrap_tfe as pywrap_tfe
|
| 9 |
+
from tensorflow.python.eager import context as _context
|
| 10 |
+
from tensorflow.python.eager import core as _core
|
| 11 |
+
from tensorflow.python.eager import execute as _execute
|
| 12 |
+
from tensorflow.python.framework import dtypes as _dtypes
|
| 13 |
+
from tensorflow.security.fuzzing.py import annotation_types as _atypes
|
| 14 |
+
|
| 15 |
+
from tensorflow.python.framework import op_def_registry as _op_def_registry
|
| 16 |
+
from tensorflow.python.framework import ops as _ops
|
| 17 |
+
from tensorflow.python.framework import op_def_library as _op_def_library
|
| 18 |
+
from tensorflow.python.util.deprecation import deprecated_endpoints
|
| 19 |
+
from tensorflow.python.util import dispatch as _dispatch
|
| 20 |
+
from tensorflow.python.util.tf_export import tf_export
|
| 21 |
+
|
| 22 |
+
from typing import TypeVar, List, Any
|
| 23 |
+
from typing_extensions import Annotated
|
| 24 |
+
|
| 25 |
+
@_dispatch.add_fallback_dispatch_list
|
| 26 |
+
@_dispatch.add_type_based_api_dispatcher
|
| 27 |
+
@tf_export('mlir_passthrough_op')
|
| 28 |
+
def mlir_passthrough_op(inputs, mlir_module: str, Toutputs, name=None):
|
| 29 |
+
r"""TODO: add doc.
|
| 30 |
+
|
| 31 |
+
Args:
|
| 32 |
+
inputs: A list of `Tensor` objects.
|
| 33 |
+
mlir_module: A `string`.
|
| 34 |
+
Toutputs: A list of `tf.DTypes`.
|
| 35 |
+
name: A name for the operation (optional).
|
| 36 |
+
|
| 37 |
+
Returns:
|
| 38 |
+
A list of `Tensor` objects of type `Toutputs`.
|
| 39 |
+
"""
|
| 40 |
+
_ctx = _context._context or _context.context()
|
| 41 |
+
tld = _ctx._thread_local_data
|
| 42 |
+
if tld.is_eager:
|
| 43 |
+
try:
|
| 44 |
+
_result = pywrap_tfe.TFE_Py_FastPathExecute(
|
| 45 |
+
_ctx, "MlirPassthroughOp", name, inputs, "mlir_module", mlir_module,
|
| 46 |
+
"Toutputs", Toutputs)
|
| 47 |
+
return _result
|
| 48 |
+
except _core._NotOkStatusException as e:
|
| 49 |
+
_ops.raise_from_not_ok_status(e, name)
|
| 50 |
+
except _core._FallbackException:
|
| 51 |
+
pass
|
| 52 |
+
try:
|
| 53 |
+
_result = _dispatcher_for_mlir_passthrough_op(
|
| 54 |
+
(inputs, mlir_module, Toutputs, name,), None)
|
| 55 |
+
if _result is not NotImplemented:
|
| 56 |
+
return _result
|
| 57 |
+
return mlir_passthrough_op_eager_fallback(
|
| 58 |
+
inputs, mlir_module=mlir_module, Toutputs=Toutputs, name=name,
|
| 59 |
+
ctx=_ctx)
|
| 60 |
+
except _core._SymbolicException:
|
| 61 |
+
pass # Add nodes to the TensorFlow graph.
|
| 62 |
+
except (TypeError, ValueError):
|
| 63 |
+
_result = _dispatch.dispatch(
|
| 64 |
+
mlir_passthrough_op, (), dict(inputs=inputs,
|
| 65 |
+
mlir_module=mlir_module,
|
| 66 |
+
Toutputs=Toutputs, name=name)
|
| 67 |
+
)
|
| 68 |
+
if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED:
|
| 69 |
+
return _result
|
| 70 |
+
raise
|
| 71 |
+
else:
|
| 72 |
+
_result = _dispatcher_for_mlir_passthrough_op(
|
| 73 |
+
(inputs, mlir_module, Toutputs, name,), None)
|
| 74 |
+
if _result is not NotImplemented:
|
| 75 |
+
return _result
|
| 76 |
+
# Add nodes to the TensorFlow graph.
|
| 77 |
+
mlir_module = _execute.make_str(mlir_module, "mlir_module")
|
| 78 |
+
if not isinstance(Toutputs, (list, tuple)):
|
| 79 |
+
raise TypeError(
|
| 80 |
+
"Expected list for 'Toutputs' argument to "
|
| 81 |
+
"'mlir_passthrough_op' Op, not %r." % Toutputs)
|
| 82 |
+
Toutputs = [_execute.make_type(_t, "Toutputs") for _t in Toutputs]
|
| 83 |
+
try:
|
| 84 |
+
_, _, _op, _outputs = _op_def_library._apply_op_helper(
|
| 85 |
+
"MlirPassthroughOp", inputs=inputs, mlir_module=mlir_module,
|
| 86 |
+
Toutputs=Toutputs, name=name)
|
| 87 |
+
except (TypeError, ValueError):
|
| 88 |
+
_result = _dispatch.dispatch(
|
| 89 |
+
mlir_passthrough_op, (), dict(inputs=inputs,
|
| 90 |
+
mlir_module=mlir_module,
|
| 91 |
+
Toutputs=Toutputs, name=name)
|
| 92 |
+
)
|
| 93 |
+
if _result is not _dispatch.OpDispatcher.NOT_SUPPORTED:
|
| 94 |
+
return _result
|
| 95 |
+
raise
|
| 96 |
+
_result = _outputs[:]
|
| 97 |
+
if _execute.must_record_gradient():
|
| 98 |
+
_attrs = ("mlir_module", _op.get_attr("mlir_module"), "Tinputs",
|
| 99 |
+
_op.get_attr("Tinputs"), "Toutputs", _op.get_attr("Toutputs"))
|
| 100 |
+
_inputs_flat = _op.inputs
|
| 101 |
+
_execute.record_gradient(
|
| 102 |
+
"MlirPassthroughOp", _inputs_flat, _attrs, _result)
|
| 103 |
+
return _result
|
| 104 |
+
|
| 105 |
+
MlirPassthroughOp = tf_export("raw_ops.MlirPassthroughOp")(_ops.to_raw_op(mlir_passthrough_op))
|
| 106 |
+
_dispatcher_for_mlir_passthrough_op = mlir_passthrough_op._tf_type_based_dispatcher.Dispatch
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
def mlir_passthrough_op_eager_fallback(inputs, mlir_module: str, Toutputs, name, ctx):
|
| 110 |
+
mlir_module = _execute.make_str(mlir_module, "mlir_module")
|
| 111 |
+
if not isinstance(Toutputs, (list, tuple)):
|
| 112 |
+
raise TypeError(
|
| 113 |
+
"Expected list for 'Toutputs' argument to "
|
| 114 |
+
"'mlir_passthrough_op' Op, not %r." % Toutputs)
|
| 115 |
+
Toutputs = [_execute.make_type(_t, "Toutputs") for _t in Toutputs]
|
| 116 |
+
_attr_Tinputs, inputs = _execute.convert_to_mixed_eager_tensors(inputs, ctx)
|
| 117 |
+
_inputs_flat = list(inputs)
|
| 118 |
+
_attrs = ("mlir_module", mlir_module, "Tinputs", _attr_Tinputs, "Toutputs",
|
| 119 |
+
Toutputs)
|
| 120 |
+
_result = _execute.execute(b"MlirPassthroughOp", len(Toutputs),
|
| 121 |
+
inputs=_inputs_flat, attrs=_attrs, ctx=ctx,
|
| 122 |
+
name=name)
|
| 123 |
+
if _execute.must_record_gradient():
|
| 124 |
+
_execute.record_gradient(
|
| 125 |
+
"MlirPassthroughOp", _inputs_flat, _attrs, _result)
|
| 126 |
+
return _result
|
| 127 |
+
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/__init__.py
ADDED
|
File without changes
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (199 Bytes). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/__pycache__/xla_data_pb2.cpython-310.pyc
ADDED
|
Binary file (11.6 kB). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/service/__init__.py
ADDED
|
File without changes
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/service/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (207 Bytes). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/service/__pycache__/hlo_pb2.cpython-310.pyc
ADDED
|
Binary file (10.9 kB). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/service/hlo_pb2.py
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
| 3 |
+
# source: xla/service/hlo.proto
|
| 4 |
+
"""Generated protocol buffer code."""
|
| 5 |
+
from google.protobuf.internal import builder as _builder
|
| 6 |
+
from google.protobuf import descriptor as _descriptor
|
| 7 |
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
| 8 |
+
from google.protobuf import symbol_database as _symbol_database
|
| 9 |
+
# @@protoc_insertion_point(imports)
|
| 10 |
+
|
| 11 |
+
_sym_db = _symbol_database.Default()
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2
|
| 15 |
+
from tensorflow.compiler.xla import xla_data_pb2 as xla_dot_xla__data__pb2
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15xla/service/hlo.proto\x12\x03xla\x1a\x19google/protobuf/any.proto\x1a\x12xla/xla_data.proto\"\xd0\x17\n\x13HloInstructionProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06opcode\x18\x02 \x01(\t\x12\x1e\n\x05shape\x18\x03 \x01(\x0b\x32\x0f.xla.ShapeProto\x12!\n\x08metadata\x18\x07 \x01(\x0b\x32\x0f.xla.OpMetadata\x12\"\n\x07literal\x18\x08 \x01(\x0b\x32\x11.xla.LiteralProto\x12\x18\n\x10parameter_number\x18\t \x01(\x03\x12\x13\n\x0b\x66usion_kind\x18\x0b \x01(\t\x12\x13\n\x0btuple_index\x18\r \x01(\x03\x12\x12\n\ndimensions\x18\x0e \x03(\x03\x12\x1b\n\x06window\x18\x0f \x01(\x0b\x32\x0b.xla.Window\x12G\n\x1d\x63onvolution_dimension_numbers\x18\x10 \x01(\x0b\x32 .xla.ConvolutionDimensionNumbers\x12\x1b\n\x13\x66\x65\x61ture_group_count\x18\x32 \x01(\x03\x12\x19\n\x11\x62\x61tch_group_count\x18: \x01(\x03\x12\x42\n\x10slice_dimensions\x18\x11 \x03(\x0b\x32(.xla.HloInstructionProto.SliceDimensions\x12\x15\n\rexponent_bits\x18\x12 \x01(\x05\x12\x15\n\rmantissa_bits\x18\x13 \x01(\x05\x12\x1b\n\x13\x64ynamic_slice_sizes\x18\x14 \x03(\x03\x12*\n\x0epadding_config\x18\x15 \x01(\x0b\x32\x12.xla.PaddingConfig\x12\x16\n\x0eoutfeed_config\x18\x16 \x01(\x0c\x12-\n\x0c\x64istribution\x18\x17 \x01(\x0e\x32\x17.xla.RandomDistribution\x12\x0f\n\x07\x65psilon\x18\x18 \x01(\x02\x12\x15\n\rfeature_index\x18\x19 \x01(\x03\x12\x12\n\nchannel_id\x18\x1a \x01(\x03\x12\x15\n\rinfeed_config\x18\x1b \x01(\x0c\x12\x1a\n\x12\x63ustom_call_target\x18\x1c \x01(\t\x12&\n\routfeed_shape\x18\x1d \x01(\x0b\x32\x0f.xla.ShapeProto\x12\x37\n\x15\x64ot_dimension_numbers\x18\x1e \x01(\x0b\x32\x18.xla.DotDimensionNumbers\x12\x1e\n\x08\x66\x66t_type\x18\x1f \x01(\x0e\x32\x0c.xla.FftType\x12\x12\n\nfft_length\x18 \x03(\x03\x12\x1c\n\x14\x63omparison_direction\x18? \x01(\t\x12=\n\x18gather_dimension_numbers\x18! \x01(\x0b\x32\x1b.xla.GatherDimensionNumbers\x12\x1a\n\x12gather_slice_sizes\x18\" \x03(\x03\x12\n\n\x02id\x18# \x01(\x03\x12\x13\n\x0boperand_ids\x18$ \x03(\x03\x12\x1f\n\x17\x63ontrol_predecessor_ids\x18% \x03(\x03\x12\x1e\n\x16\x63\x61lled_computation_ids\x18& \x03(\x03\x12!\n\x08sharding\x18( \x01(\x0b\x32\x0f.xla.OpSharding\x12\x16\n\x0e\x62\x61\x63kend_config\x18+ \x01(\x0c\x12-\n\x0ereplica_groups\x18\x31 \x03(\x0b\x32\x11.xla.ReplicaGroupB\x02\x18\x01\x12\x19\n\rall_reduce_id\x18- \x01(\x03\x42\x02\x18\x01\x12\x1d\n\x15use_global_device_ids\x18G \x01(\x08\x12\x18\n\x10is_host_transfer\x18/ \x01(\x08\x12\x11\n\tis_stable\x18< \x01(\x08\x12?\n\x19scatter_dimension_numbers\x18\x30 \x01(\x0b\x32\x1c.xla.ScatterDimensionNumbers\x12.\n\x10precision_config\x18\x33 \x01(\x0b\x32\x14.xla.PrecisionConfig\x12.\n\x13source_target_pairs\x18\x34 \x03(\x0b\x32\x11.xla.SourceTarget\x12.\n\x15\x64omain_entry_sharding\x18\x36 \x01(\x0b\x32\x0f.xla.OpSharding\x12-\n\x14\x64omain_exit_sharding\x18\x37 \x01(\x0b\x32\x0f.xla.OpSharding\x12\x18\n\x10\x63onstrain_layout\x18\x38 \x01(\x08\x12\x33\n\x1aoperand_shapes_with_layout\x18\x39 \x03(\x0b\x32\x0f.xla.ShapeProto\x12=\n\x18triangular_solve_options\x18; \x01(\x0b\x32\x1b.xla.TriangularSolveOptions\x12.\n\x10\x63holesky_options\x18> \x01(\x0b\x32\x14.xla.CholeskyOptions\x12\x38\n\x15parameter_replication\x18= \x01(\x0b\x32\x19.xla.ParameterReplication\x12#\n\x1b\x63ustom_call_has_side_effect\x18\x41 \x01(\x08\x12;\n\x17output_operand_aliasing\x18J \x03(\x0b\x32\x1a.xla.OutputOperandAliasing\x12\x35\n\x14\x63ustom_call_schedule\x18L \x01(\x0e\x32\x17.xla.CustomCallSchedule\x12\r\n\x05\x64\x65lta\x18\x42 \x01(\x03\x12\x1a\n\x12indices_are_sorted\x18\x43 \x01(\x08\x12\x34\n\x13\x66rontend_attributes\x18\x44 \x01(\x0b\x32\x17.xla.FrontendAttributes\x12\x16\n\x0eunique_indices\x18\x45 \x01(\x08\x12+\n\rrng_algorithm\x18\x46 \x01(\x0e\x32\x14.xla.RandomAlgorithm\x12\x17\n\x0f\x63omparison_type\x18H \x01(\t\x12%\n\x19is_cross_program_prefetch\x18I \x01(\x08\x42\x02\x18\x01\x12&\n\x1c\x63ross_program_prefetch_index\x18P \x01(\x05H\x00\x12&\n\x0cpadding_type\x18K \x01(\x0e\x32\x10.xla.PaddingType\x12:\n\x17\x63ustom_call_api_version\x18M \x01(\x0e\x32\x19.xla.CustomCallApiVersion\x12\x1e\n\x16\x61sync_execution_thread\x18O \x01(\t\x12\t\n\x01k\x18Q \x01(\x03\x12\x0f\n\x07largest\x18U \x01(\x08\x12*\n\x0estatistics_viz\x18R \x01(\x0b\x32\x12.xla.StatisticsViz\x12-\n\x0c\x64ot_sparsity\x18V \x03(\x0b\x32\x17.xla.SparsityDescriptor\x12>\n\x16\x63ollective_device_list\x18W \x01(\x0b\x32\x1e.xla.CollectiveDeviceListProto\x12/\n\x0eoriginal_value\x18X \x01(\x0b\x32\x17.xla.OriginalValueProto\x12\x14\n\x0cis_composite\x18Y \x01(\x08\x1a?\n\x0fSliceDimensions\x12\r\n\x05start\x18\x01 \x01(\x03\x12\r\n\x05limit\x18\x02 \x01(\x03\x12\x0e\n\x06stride\x18\x03 \x01(\x03\x42\'\n%optional_cross_program_prefetch_indexJ\x04\x08\n\x10\x0bJ\x04\x08\x0c\x10\rJ\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07J\x04\x08,\x10-J\x04\x08\x35\x10\x36J\x04\x08.\x10/J\x04\x08)\x10*J\x04\x08*\x10+J\x04\x08@\x10\x41J\x04\x08N\x10OJ\x04\x08S\x10TJ\x04\x08T\x10UR\x0eparameter_nameR\x1e\x66used_instructions_computationR\roperand_namesR\x19\x63ontrol_predecessor_namesR\x18\x63\x61lled_computation_namesR\x11replica_group_idsR\x12\x63ustom_call_opaqueR\x12\x61ll_reduce_barrier\"\xe9\x01\n\x13HloComputationProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12.\n\x0cinstructions\x18\x02 \x03(\x0b\x32\x18.xla.HloInstructionProto\x12-\n\rprogram_shape\x18\x04 \x01(\x0b\x32\x16.xla.ProgramShapeProto\x12\n\n\x02id\x18\x05 \x01(\x03\x12\x0f\n\x07root_id\x18\x06 \x01(\x03\x12\x1d\n\x15is_fusion_computation\x18\x07 \x01(\x08\x12\x18\n\x10\x65xecution_thread\x18\x08 \x01(\tJ\x04\x08\x03\x10\x04R\troot_name\"\xd8\x01\n\x10HloScheduleProto\x12\x37\n\tsequences\x18\x01 \x03(\x0b\x32$.xla.HloScheduleProto.SequencesEntry\x1a.\n\x13InstructionSequence\x12\x17\n\x0finstruction_ids\x18\x01 \x03(\x03\x1a[\n\x0eSequencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).xla.HloScheduleProto.InstructionSequence:\x02\x38\x01\"\xdb\x01\n\x18HloInputOutputAliasProto\x12>\n\x07\x65ntries\x18\x01 \x03(\x0b\x32-.xla.HloInputOutputAliasProto.AliasEntryProto\x1a\x7f\n\x0f\x41liasEntryProto\x12\x1a\n\x12output_shape_index\x18\x01 \x03(\x03\x12\x18\n\x10parameter_number\x18\x02 \x01(\x03\x12\x1d\n\x15parameter_shape_index\x18\x03 \x03(\x03\x12\x17\n\x04kind\x18\x04 \x01(\x0e\x32\t.xla.Kind\"\xa8\x01\n\x13HloBufferDonorProto\x12?\n\x07\x65ntries\x18\x01 \x03(\x0b\x32..xla.HloBufferDonorProto.BufferDonorEntryProto\x1aP\n\x15\x42ufferDonorEntryProto\x12\x18\n\x10parameter_number\x18\x01 \x01(\x03\x12\x1d\n\x15parameter_shape_index\x18\x02 \x03(\x03\"H\n\x14\x43rossProgramPrefetch\x12\x11\n\tparameter\x18\x01 \x01(\x03\x12\r\n\x05index\x18\x02 \x03(\x03\x12\x0e\n\x06offset\x18\x03 \x01(\x03\"\xdd\x02\n\x14StackFrameIndexProto\x12\x12\n\nfile_names\x18\x01 \x03(\t\x12\x16\n\x0e\x66unction_names\x18\x02 \x03(\t\x12>\n\x0e\x66ile_locations\x18\x03 \x03(\x0b\x32&.xla.StackFrameIndexProto.FileLocation\x12:\n\x0cstack_frames\x18\x04 \x03(\x0b\x32$.xla.StackFrameIndexProto.StackFrame\x1a\\\n\x0c\x46ileLocation\x12\x14\n\x0c\x66ile_name_id\x18\x01 \x01(\x05\x12\x18\n\x10\x66unction_name_id\x18\x02 \x01(\x05\x12\x0c\n\x04line\x18\x03 \x01(\x05\x12\x0e\n\x06\x63olumn\x18\x04 \x01(\x05\x1a?\n\nStackFrame\x12\x18\n\x10\x66ile_location_id\x18\x01 \x01(\x05\x12\x17\n\x0fparent_frame_id\x18\x02 \x01(\x05\"\xdb\x08\n\x0eHloModuleProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1e\n\x16\x65ntry_computation_name\x18\x02 \x01(\t\x12\x1c\n\x14\x65ntry_computation_id\x18\x06 \x01(\x03\x12.\n\x0c\x63omputations\x18\x03 \x03(\x0b\x32\x18.xla.HloComputationProto\x12\x32\n\x12host_program_shape\x18\x04 \x01(\x0b\x32\x16.xla.ProgramShapeProto\x12\n\n\x02id\x18\x05 \x01(\x03\x12\'\n\x08schedule\x18\x07 \x01(\x0b\x32\x15.xla.HloScheduleProto\x12\x39\n\x12input_output_alias\x18\x08 \x01(\x0b\x32\x1d.xla.HloInputOutputAliasProto\x12.\n\x0c\x62uffer_donor\x18\x12 \x01(\x0b\x32\x18.xla.HloBufferDonorProto\x12;\n\x18\x63ross_program_prefetches\x18\n \x03(\x0b\x32\x19.xla.CrossProgramPrefetch\x12\x12\n\nis_dynamic\x18\x0b \x01(\x08\x12-\n\x14spmd_output_sharding\x18\x0c \x01(\x0b\x32\x0f.xla.OpSharding\x12\x32\n\x19spmd_parameters_shardings\x18\x0e \x03(\x0b\x32\x0f.xla.OpSharding\x12\"\n\x1ause_auto_spmd_partitioning\x18\x10 \x01(\x08\x12\x35\n\x0cprofile_info\x18\r \x03(\x0b\x32\x1f.xla.HloModuleProto.ProfileInfo\x12\x35\n\x11\x64\x65vice_assignment\x18\x0f \x01(\x0b\x32\x1a.xla.DeviceAssignmentProto\x12\x34\n\x11stack_frame_index\x18\x11 \x01(\x0b\x32\x19.xla.StackFrameIndexProto\x12\x34\n\x13\x66rontend_attributes\x18\x13 \x01(\x0b\x32\x17.xla.FrontendAttributes\x1a\xd1\x01\n\x0bProfileInfo\x12\x35\n\x0cprofile_type\x18\x01 \x01(\x0e\x32\x1f.xla.HloModuleProto.ProfileType\x12\x18\n\x10relative_speedup\x18\x02 \x01(\x01\x12*\n\x0eprofile_source\x18\x03 \x01(\x0e\x32\x12.xla.ProfileSource\x12\x30\n\x11\x63ompilation_event\x18\x04 \x01(\x0e\x32\x15.xla.CompilationEvent\x12\x13\n\x0b\x66ingerprint\x18\x05 \x01(\t\"R\n\x0bProfileType\x12\x0b\n\x07INVALID\x10\x00\x12\x08\n\x04\x46LAG\x10\x01\x12\n\n\x06\x46USION\x10\x02\x12\n\n\x06LAYOUT\x10\x03\x12\x07\n\x03\x44OT\x10\x04\x12\x0b\n\x07\x46LAGNET\x10\x05J\x04\x08\t\x10\nR\x19\x64ynamic_parameter_binding\"\xd0\x01\n\x12LogicalBufferProto\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0c\n\x04size\x18\x02 \x01(\x03\x12\x34\n\ndefined_at\x18\x03 \x01(\x0b\x32 .xla.LogicalBufferProto.Location\x12\r\n\x05\x63olor\x18\x04 \x01(\x03\x1a[\n\x08Location\x12\x1c\n\x10instruction_name\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\x0einstruction_id\x18\x04 \x01(\x03\x12\x13\n\x0bshape_index\x18\x03 \x03(\x03J\x04\x08\x01\x10\x02\"\xf8\x02\n\x15\x42ufferAllocationProto\x12\r\n\x05index\x18\x01 \x01(\x03\x12\x0c\n\x04size\x18\x02 \x01(\x03\x12\x17\n\x0fis_thread_local\x18\x03 \x01(\x08\x12\x10\n\x08is_tuple\x18\x0b \x01(\x08\x12&\n\x1eis_entry_computation_parameter\x18\x05 \x01(\x08\x12\x13\n\x0bis_constant\x18\x0c \x01(\x08\x12\x18\n\x10parameter_number\x18\x06 \x01(\x03\x12\x1d\n\x15parameter_shape_index\x18\n \x03(\x03\x12\x16\n\x0emaybe_live_out\x18\x07 \x01(\x08\x12\r\n\x05\x63olor\x18\x08 \x01(\x03\x12\x35\n\x08\x61ssigned\x18\t \x03(\x0b\x32#.xla.BufferAllocationProto.Assigned\x1a\x43\n\x08\x41ssigned\x12\x19\n\x11logical_buffer_id\x18\x01 \x01(\x03\x12\x0e\n\x06offset\x18\x02 \x01(\x03\x12\x0c\n\x04size\x18\x03 \x01(\x03\"\xd6\x02\n\x12HeapSimulatorTrace\x12-\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x1d.xla.HeapSimulatorTrace.Event\x12\x1f\n\x17whole_module_simulation\x18\x02 \x01(\x08\x12\x1f\n\x17\x62uffer_allocation_index\x18\x03 \x01(\x03\x1a\xce\x01\n\x05\x45vent\x12\x30\n\x04kind\x18\x01 \x01(\x0e\x32\".xla.HeapSimulatorTrace.Event.Kind\x12\x11\n\tbuffer_id\x18\x02 \x01(\x03\x12\x18\n\x10\x63omputation_name\x18\x03 \x01(\t\x12\x18\n\x10instruction_name\x18\x04 \x01(\t\x12\x1f\n\x17share_with_canonical_id\x18\x05 \x01(\x03\"+\n\x04Kind\x12\t\n\x05\x41LLOC\x10\x00\x12\x08\n\x04\x46REE\x10\x01\x12\x0e\n\nSHARE_WITH\x10\x02\"M\n\x13HloModuleGroupProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12(\n\x0bhlo_modules\x18\x02 \x03(\x0b\x32\x13.xla.HloModuleProto\"\xd6\x02\n\x15\x42ufferAssignmentProto\x12\x30\n\x0flogical_buffers\x18\x01 \x03(\x0b\x32\x17.xla.LogicalBufferProto\x12>\n\x0e\x62uffer_aliases\x18\x02 \x03(\x0b\x32&.xla.BufferAssignmentProto.BufferAlias\x12\x36\n\x12\x62uffer_allocations\x18\x03 \x03(\x0b\x32\x1a.xla.BufferAllocationProto\x12\x36\n\x15heap_simulator_traces\x18\x04 \x03(\x0b\x32\x17.xla.HeapSimulatorTrace\x1a[\n\x0b\x42ufferAlias\x12\x18\n\x10source_buffer_id\x18\x01 \x01(\x03\x12\x32\n\x08location\x18\x02 \x01(\x0b\x32 .xla.LogicalBufferProto.Location\"~\n\x08HloProto\x12\'\n\nhlo_module\x18\x01 \x01(\x0b\x32\x13.xla.HloModuleProto\x12\x35\n\x11\x62uffer_assignment\x18\x03 \x01(\x0b\x32\x1a.xla.BufferAssignmentProtoJ\x04\x08\x02\x10\x03R\x0chlo_ordering\"\x8e\x01\n\x0bHloSnapshot\x12\x1a\n\x03hlo\x18\x01 \x01(\x0b\x32\r.xla.HloProto\x12$\n\targuments\x18\x02 \x03(\x0b\x32\x11.xla.LiteralProto\x12!\n\x06result\x18\x03 \x01(\x0b\x32\x11.xla.LiteralProto\x12\x1a\n\x12\x65xecution_platform\x18\x04 \x01(\t\"\xb9\x01\n\x16HloModuleMetadataProto\x12\x1b\n\x13\x63\x61nonical_module_id\x18\x01 \x01(\x03\x12\x19\n\x11module_group_name\x18\x02 \x01(\t\x12\x1a\n\x12original_module_id\x18\x03 \x01(\x03\x12\x1e\n\x16partitioned_module_ids\x18\x04 \x03(\x03\x12+\n\rpass_metadata\x18\x05 \x03(\x0b\x32\x14.xla.HloPassMetadata\"\x99\x02\n\x0fHloPassMetadata\x12\x0f\n\x07pass_id\x18\x01 \x01(\x03\x12\x11\n\tpass_name\x18\x02 \x01(\t\x12\x15\n\rpipeline_name\x18\x03 \x01(\t\x12\x16\n\x0e\x64ump_filenames\x18\x04 \x03(\t\x12\x16\n\x0emodule_changed\x18\x05 \x01(\x08\x12\x11\n\tmodule_id\x18\x06 \x01(\x03\x12\x1f\n\x17module_group_module_ids\x18\x07 \x03(\x03\x12\x1c\n\x14start_timestamp_usec\x18\x08 \x01(\x03\x12\x1a\n\x12\x65nd_timestamp_usec\x18\t \x01(\x03\x12-\n\x0f\x63ustom_metadata\x18\n \x01(\x0b\x32\x14.google.protobuf.Any*S\n\x12\x43ustomCallSchedule\x12\x11\n\rSCHEDULE_NONE\x10\x00\x12\x13\n\x0fSCHEDULE_LATEST\x10\x01\x12\x15\n\x11SCHEDULE_EARLIEST\x10\x02*\xb4\x01\n\x14\x43ustomCallApiVersion\x12\x1b\n\x17\x41PI_VERSION_UNSPECIFIED\x10\x00\x12\x18\n\x14\x41PI_VERSION_ORIGINAL\x10\x01\x12 \n\x1c\x41PI_VERSION_STATUS_RETURNING\x10\x02\x12(\n$API_VERSION_STATUS_RETURNING_UNIFIED\x10\x03\x12\x19\n\x15\x41PI_VERSION_TYPED_FFI\x10\x04*:\n\x04Kind\x12\x13\n\x0fUNDEFINED_ALIAS\x10\x00\x12\r\n\tMAY_ALIAS\x10\x01\x12\x0e\n\nMUST_ALIAS\x10\x02\x42\x03\xf8\x01\x01\x62\x06proto3')
|
| 19 |
+
|
| 20 |
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
| 21 |
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xla.service.hlo_pb2', globals())
|
| 22 |
+
if _descriptor._USE_C_DESCRIPTORS == False:
|
| 23 |
+
|
| 24 |
+
DESCRIPTOR._options = None
|
| 25 |
+
DESCRIPTOR._serialized_options = b'\370\001\001'
|
| 26 |
+
_HLOINSTRUCTIONPROTO.fields_by_name['replica_groups']._options = None
|
| 27 |
+
_HLOINSTRUCTIONPROTO.fields_by_name['replica_groups']._serialized_options = b'\030\001'
|
| 28 |
+
_HLOINSTRUCTIONPROTO.fields_by_name['all_reduce_id']._options = None
|
| 29 |
+
_HLOINSTRUCTIONPROTO.fields_by_name['all_reduce_id']._serialized_options = b'\030\001'
|
| 30 |
+
_HLOINSTRUCTIONPROTO.fields_by_name['is_cross_program_prefetch']._options = None
|
| 31 |
+
_HLOINSTRUCTIONPROTO.fields_by_name['is_cross_program_prefetch']._serialized_options = b'\030\001'
|
| 32 |
+
_HLOSCHEDULEPROTO_SEQUENCESENTRY._options = None
|
| 33 |
+
_HLOSCHEDULEPROTO_SEQUENCESENTRY._serialized_options = b'8\001'
|
| 34 |
+
_LOGICALBUFFERPROTO_LOCATION.fields_by_name['instruction_name']._options = None
|
| 35 |
+
_LOGICALBUFFERPROTO_LOCATION.fields_by_name['instruction_name']._serialized_options = b'\030\001'
|
| 36 |
+
_CUSTOMCALLSCHEDULE._serialized_start=7600
|
| 37 |
+
_CUSTOMCALLSCHEDULE._serialized_end=7683
|
| 38 |
+
_CUSTOMCALLAPIVERSION._serialized_start=7686
|
| 39 |
+
_CUSTOMCALLAPIVERSION._serialized_end=7866
|
| 40 |
+
_KIND._serialized_start=7868
|
| 41 |
+
_KIND._serialized_end=7926
|
| 42 |
+
_HLOINSTRUCTIONPROTO._serialized_start=78
|
| 43 |
+
_HLOINSTRUCTIONPROTO._serialized_end=3102
|
| 44 |
+
_HLOINSTRUCTIONPROTO_SLICEDIMENSIONS._serialized_start=2739
|
| 45 |
+
_HLOINSTRUCTIONPROTO_SLICEDIMENSIONS._serialized_end=2802
|
| 46 |
+
_HLOCOMPUTATIONPROTO._serialized_start=3105
|
| 47 |
+
_HLOCOMPUTATIONPROTO._serialized_end=3338
|
| 48 |
+
_HLOSCHEDULEPROTO._serialized_start=3341
|
| 49 |
+
_HLOSCHEDULEPROTO._serialized_end=3557
|
| 50 |
+
_HLOSCHEDULEPROTO_INSTRUCTIONSEQUENCE._serialized_start=3418
|
| 51 |
+
_HLOSCHEDULEPROTO_INSTRUCTIONSEQUENCE._serialized_end=3464
|
| 52 |
+
_HLOSCHEDULEPROTO_SEQUENCESENTRY._serialized_start=3466
|
| 53 |
+
_HLOSCHEDULEPROTO_SEQUENCESENTRY._serialized_end=3557
|
| 54 |
+
_HLOINPUTOUTPUTALIASPROTO._serialized_start=3560
|
| 55 |
+
_HLOINPUTOUTPUTALIASPROTO._serialized_end=3779
|
| 56 |
+
_HLOINPUTOUTPUTALIASPROTO_ALIASENTRYPROTO._serialized_start=3652
|
| 57 |
+
_HLOINPUTOUTPUTALIASPROTO_ALIASENTRYPROTO._serialized_end=3779
|
| 58 |
+
_HLOBUFFERDONORPROTO._serialized_start=3782
|
| 59 |
+
_HLOBUFFERDONORPROTO._serialized_end=3950
|
| 60 |
+
_HLOBUFFERDONORPROTO_BUFFERDONORENTRYPROTO._serialized_start=3870
|
| 61 |
+
_HLOBUFFERDONORPROTO_BUFFERDONORENTRYPROTO._serialized_end=3950
|
| 62 |
+
_CROSSPROGRAMPREFETCH._serialized_start=3952
|
| 63 |
+
_CROSSPROGRAMPREFETCH._serialized_end=4024
|
| 64 |
+
_STACKFRAMEINDEXPROTO._serialized_start=4027
|
| 65 |
+
_STACKFRAMEINDEXPROTO._serialized_end=4376
|
| 66 |
+
_STACKFRAMEINDEXPROTO_FILELOCATION._serialized_start=4219
|
| 67 |
+
_STACKFRAMEINDEXPROTO_FILELOCATION._serialized_end=4311
|
| 68 |
+
_STACKFRAMEINDEXPROTO_STACKFRAME._serialized_start=4313
|
| 69 |
+
_STACKFRAMEINDEXPROTO_STACKFRAME._serialized_end=4376
|
| 70 |
+
_HLOMODULEPROTO._serialized_start=4379
|
| 71 |
+
_HLOMODULEPROTO._serialized_end=5494
|
| 72 |
+
_HLOMODULEPROTO_PROFILEINFO._serialized_start=5168
|
| 73 |
+
_HLOMODULEPROTO_PROFILEINFO._serialized_end=5377
|
| 74 |
+
_HLOMODULEPROTO_PROFILETYPE._serialized_start=5379
|
| 75 |
+
_HLOMODULEPROTO_PROFILETYPE._serialized_end=5461
|
| 76 |
+
_LOGICALBUFFERPROTO._serialized_start=5497
|
| 77 |
+
_LOGICALBUFFERPROTO._serialized_end=5705
|
| 78 |
+
_LOGICALBUFFERPROTO_LOCATION._serialized_start=5614
|
| 79 |
+
_LOGICALBUFFERPROTO_LOCATION._serialized_end=5705
|
| 80 |
+
_BUFFERALLOCATIONPROTO._serialized_start=5708
|
| 81 |
+
_BUFFERALLOCATIONPROTO._serialized_end=6084
|
| 82 |
+
_BUFFERALLOCATIONPROTO_ASSIGNED._serialized_start=6017
|
| 83 |
+
_BUFFERALLOCATIONPROTO_ASSIGNED._serialized_end=6084
|
| 84 |
+
_HEAPSIMULATORTRACE._serialized_start=6087
|
| 85 |
+
_HEAPSIMULATORTRACE._serialized_end=6429
|
| 86 |
+
_HEAPSIMULATORTRACE_EVENT._serialized_start=6223
|
| 87 |
+
_HEAPSIMULATORTRACE_EVENT._serialized_end=6429
|
| 88 |
+
_HEAPSIMULATORTRACE_EVENT_KIND._serialized_start=6386
|
| 89 |
+
_HEAPSIMULATORTRACE_EVENT_KIND._serialized_end=6429
|
| 90 |
+
_HLOMODULEGROUPPROTO._serialized_start=6431
|
| 91 |
+
_HLOMODULEGROUPPROTO._serialized_end=6508
|
| 92 |
+
_BUFFERASSIGNMENTPROTO._serialized_start=6511
|
| 93 |
+
_BUFFERASSIGNMENTPROTO._serialized_end=6853
|
| 94 |
+
_BUFFERASSIGNMENTPROTO_BUFFERALIAS._serialized_start=6762
|
| 95 |
+
_BUFFERASSIGNMENTPROTO_BUFFERALIAS._serialized_end=6853
|
| 96 |
+
_HLOPROTO._serialized_start=6855
|
| 97 |
+
_HLOPROTO._serialized_end=6981
|
| 98 |
+
_HLOSNAPSHOT._serialized_start=6984
|
| 99 |
+
_HLOSNAPSHOT._serialized_end=7126
|
| 100 |
+
_HLOMODULEMETADATAPROTO._serialized_start=7129
|
| 101 |
+
_HLOMODULEMETADATAPROTO._serialized_end=7314
|
| 102 |
+
_HLOPASSMETADATA._serialized_start=7317
|
| 103 |
+
_HLOPASSMETADATA._serialized_end=7598
|
| 104 |
+
# @@protoc_insertion_point(module_scope)
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/tsl/__init__.py
ADDED
|
File without changes
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/tsl/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (203 Bytes). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/tsl/protobuf/__init__.py
ADDED
|
File without changes
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/tsl/protobuf/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (212 Bytes). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/tsl/protobuf/__pycache__/bfc_memory_map_pb2.cpython-310.pyc
ADDED
|
Binary file (1.97 kB). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/tsl/protobuf/__pycache__/test_log_pb2.cpython-310.pyc
ADDED
|
Binary file (4.36 kB). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/tsl/protobuf/bfc_memory_map_pb2.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
| 3 |
+
# source: xla/tsl/protobuf/bfc_memory_map.proto
|
| 4 |
+
"""Generated protocol buffer code."""
|
| 5 |
+
from google.protobuf.internal import builder as _builder
|
| 6 |
+
from google.protobuf import descriptor as _descriptor
|
| 7 |
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
| 8 |
+
from google.protobuf import symbol_database as _symbol_database
|
| 9 |
+
# @@protoc_insertion_point(imports)
|
| 10 |
+
|
| 11 |
+
_sym_db = _symbol_database.Default()
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%xla/tsl/protobuf/bfc_memory_map.proto\x12\ntensorflow\"\x92\x01\n\x11MemAllocatorStats\x12\x12\n\nnum_allocs\x18\x01 \x01(\x03\x12\x14\n\x0c\x62ytes_in_use\x18\x02 \x01(\x03\x12\x19\n\x11peak_bytes_in_use\x18\x03 \x01(\x03\x12\x1a\n\x12largest_alloc_size\x18\x04 \x01(\x03\x12\x1c\n\x14\x66ragmentation_metric\x18\x05 \x01(\x02\"\xae\x01\n\x08MemChunk\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\x04\x12\x0c\n\x04size\x18\x02 \x01(\x03\x12\x16\n\x0erequested_size\x18\x03 \x01(\x03\x12\x0b\n\x03\x62in\x18\x04 \x01(\x05\x12\x0f\n\x07op_name\x18\x05 \x01(\t\x12\x16\n\x0e\x66reed_at_count\x18\x06 \x01(\x04\x12\x14\n\x0c\x61\x63tion_count\x18\x07 \x01(\x04\x12\x0e\n\x06in_use\x18\x08 \x01(\x08\x12\x0f\n\x07step_id\x18\t \x01(\x04\"\x8b\x01\n\nBinSummary\x12\x0b\n\x03\x62in\x18\x01 \x01(\x05\x12\x1a\n\x12total_bytes_in_use\x18\x02 \x01(\x03\x12\x1a\n\x12total_bytes_in_bin\x18\x03 \x01(\x03\x12\x1b\n\x13total_chunks_in_use\x18\x04 \x01(\x03\x12\x1b\n\x13total_chunks_in_bin\x18\x05 \x01(\x03\".\n\x08SnapShot\x12\x14\n\x0c\x61\x63tion_count\x18\x01 \x01(\x04\x12\x0c\n\x04size\x18\x02 \x01(\x03\"\xcd\x01\n\nMemoryDump\x12\x16\n\x0e\x61llocator_name\x18\x01 \x01(\t\x12+\n\x0b\x62in_summary\x18\x02 \x03(\x0b\x32\x16.tensorflow.BinSummary\x12#\n\x05\x63hunk\x18\x03 \x03(\x0b\x32\x14.tensorflow.MemChunk\x12\'\n\tsnap_shot\x18\x04 \x03(\x0b\x32\x14.tensorflow.SnapShot\x12,\n\x05stats\x18\x05 \x01(\x0b\x32\x1d.tensorflow.MemAllocatorStatsB@Z>github.com/google/tsl/tsl/go/protobuf/for_core_protos_go_protob\x06proto3')
|
| 17 |
+
|
| 18 |
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
| 19 |
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xla.tsl.protobuf.bfc_memory_map_pb2', globals())
|
| 20 |
+
if _descriptor._USE_C_DESCRIPTORS == False:
|
| 21 |
+
|
| 22 |
+
DESCRIPTOR._options = None
|
| 23 |
+
DESCRIPTOR._serialized_options = b'Z>github.com/google/tsl/tsl/go/protobuf/for_core_protos_go_proto'
|
| 24 |
+
_MEMALLOCATORSTATS._serialized_start=54
|
| 25 |
+
_MEMALLOCATORSTATS._serialized_end=200
|
| 26 |
+
_MEMCHUNK._serialized_start=203
|
| 27 |
+
_MEMCHUNK._serialized_end=377
|
| 28 |
+
_BINSUMMARY._serialized_start=380
|
| 29 |
+
_BINSUMMARY._serialized_end=519
|
| 30 |
+
_SNAPSHOT._serialized_start=521
|
| 31 |
+
_SNAPSHOT._serialized_end=567
|
| 32 |
+
_MEMORYDUMP._serialized_start=570
|
| 33 |
+
_MEMORYDUMP._serialized_end=775
|
| 34 |
+
# @@protoc_insertion_point(module_scope)
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/tsl/protobuf/test_log_pb2.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
| 3 |
+
# source: xla/tsl/protobuf/test_log.proto
|
| 4 |
+
"""Generated protocol buffer code."""
|
| 5 |
+
from google.protobuf.internal import builder as _builder
|
| 6 |
+
from google.protobuf import descriptor as _descriptor
|
| 7 |
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
| 8 |
+
from google.protobuf import symbol_database as _symbol_database
|
| 9 |
+
# @@protoc_insertion_point(imports)
|
| 10 |
+
|
| 11 |
+
_sym_db = _symbol_database.Default()
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2
|
| 15 |
+
from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fxla/tsl/protobuf/test_log.proto\x12\ntensorflow\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/wrappers.proto\"D\n\nEntryValue\x12\x16\n\x0c\x64ouble_value\x18\x01 \x01(\x01H\x00\x12\x16\n\x0cstring_value\x18\x02 \x01(\tH\x00\x42\x06\n\x04kind\"\x8c\x01\n\x0bMetricEntry\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01\x12/\n\tmin_value\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12/\n\tmax_value\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\"\x8f\x02\n\x0e\x42\x65nchmarkEntry\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05iters\x18\x02 \x01(\x03\x12\x10\n\x08\x63pu_time\x18\x03 \x01(\x01\x12\x11\n\twall_time\x18\x04 \x01(\x01\x12\x12\n\nthroughput\x18\x05 \x01(\x01\x12\x36\n\x06\x65xtras\x18\x06 \x03(\x0b\x32&.tensorflow.BenchmarkEntry.ExtrasEntry\x12(\n\x07metrics\x18\x07 \x03(\x0b\x32\x17.tensorflow.MetricEntry\x1a\x45\n\x0b\x45xtrasEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.tensorflow.EntryValue:\x02\x38\x01\"=\n\x10\x42\x65nchmarkEntries\x12)\n\x05\x65ntry\x18\x01 \x03(\x0b\x32\x1a.tensorflow.BenchmarkEntry\"B\n\x12\x42uildConfiguration\x12\x0c\n\x04mode\x18\x01 \x01(\t\x12\x10\n\x08\x63\x63_flags\x18\x02 \x03(\t\x12\x0c\n\x04opts\x18\x03 \x03(\t\"f\n\x08\x43ommitId\x12\x14\n\nchangelist\x18\x01 \x01(\x03H\x00\x12\x0e\n\x04hash\x18\x02 \x01(\tH\x00\x12\x10\n\x08snapshot\x18\x03 \x01(\t\x12\x1a\n\x12pending_changelist\x18\x04 \x01(\x03\x42\x06\n\x04kind\"\xde\x01\n\x07\x43PUInfo\x12\x11\n\tnum_cores\x18\x01 \x01(\x03\x12\x19\n\x11num_cores_allowed\x18\x02 \x01(\x03\x12\x13\n\x0bmhz_per_cpu\x18\x03 \x01(\x01\x12\x10\n\x08\x63pu_info\x18\x04 \x01(\t\x12\x14\n\x0c\x63pu_governor\x18\x05 \x01(\t\x12\x36\n\ncache_size\x18\x06 \x03(\x0b\x32\".tensorflow.CPUInfo.CacheSizeEntry\x1a\x30\n\x0e\x43\x61\x63heSizeEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\".\n\nMemoryInfo\x12\r\n\x05total\x18\x01 \x01(\x03\x12\x11\n\tavailable\x18\x02 \x01(\x03\"6\n\x07GPUInfo\x12\r\n\x05model\x18\x01 \x01(\t\x12\x0c\n\x04uuid\x18\x02 \x01(\t\x12\x0e\n\x06\x62us_id\x18\x03 \x01(\t\"p\n\x0cPlatformInfo\x12\x0c\n\x04\x62its\x18\x01 \x01(\t\x12\x0f\n\x07linkage\x18\x02 \x01(\t\x12\x0f\n\x07machine\x18\x03 \x01(\t\x12\x0f\n\x07release\x18\x04 \x01(\t\x12\x0e\n\x06system\x18\x05 \x01(\t\x12\x0f\n\x07version\x18\x06 \x01(\t\"e\n\x13\x41vailableDeviceInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x14\n\x0cmemory_limit\x18\x03 \x01(\x03\x12\x1c\n\x14physical_description\x18\x04 \x01(\t\"\xb3\x02\n\x14MachineConfiguration\x12\x10\n\x08hostname\x18\x01 \x01(\t\x12\x19\n\x11serial_identifier\x18\x07 \x01(\t\x12/\n\rplatform_info\x18\x02 \x01(\x0b\x32\x18.tensorflow.PlatformInfo\x12%\n\x08\x63pu_info\x18\x03 \x01(\x0b\x32\x13.tensorflow.CPUInfo\x12)\n\x0b\x64\x65vice_info\x18\x04 \x03(\x0b\x32\x14.google.protobuf.Any\x12>\n\x15\x61vailable_device_info\x18\x05 \x03(\x0b\x32\x1f.tensorflow.AvailableDeviceInfo\x12+\n\x0bmemory_info\x18\x06 \x01(\x0b\x32\x16.tensorflow.MemoryInfo\"\x91\x01\n\x10RunConfiguration\x12\x10\n\x08\x61rgument\x18\x01 \x03(\t\x12;\n\x08\x65nv_vars\x18\x02 \x03(\x0b\x32).tensorflow.RunConfiguration.EnvVarsEntry\x1a.\n\x0c\x45nvVarsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd0\x04\n\x0bTestResults\x12\x0e\n\x06target\x18\x01 \x01(\t\x12-\n\x07\x65ntries\x18\x02 \x01(\x0b\x32\x1c.tensorflow.BenchmarkEntries\x12;\n\x13\x62uild_configuration\x18\x03 \x01(\x0b\x32\x1e.tensorflow.BuildConfiguration\x12\'\n\tcommit_id\x18\x04 \x01(\x0b\x32\x14.tensorflow.CommitId\x12\x12\n\nstart_time\x18\x05 \x01(\x03\x12\x10\n\x08run_time\x18\x06 \x01(\x01\x12?\n\x15machine_configuration\x18\x07 \x01(\x0b\x32 .tensorflow.MachineConfiguration\x12\x37\n\x11run_configuration\x18\x08 \x01(\x0b\x32\x1c.tensorflow.RunConfiguration\x12\x0c\n\x04name\x18\t \x01(\t\x12=\n\x0e\x62\x65nchmark_type\x18\n \x01(\x0e\x32%.tensorflow.TestResults.BenchmarkType\x12\x10\n\x08run_mode\x18\x0b \x01(\t\x12\x12\n\ntf_version\x18\x0c \x01(\t\"\x88\x01\n\rBenchmarkType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x16\n\x12\x43PP_MICROBENCHMARK\x10\x01\x12\x14\n\x10PYTHON_BENCHMARK\x10\x02\x12\x15\n\x11\x41NDROID_BENCHMARK\x10\x03\x12\x12\n\x0e\x45\x44GE_BENCHMARK\x10\x04\x12\x11\n\rIOS_BENCHMARK\x10\x05\x42\x31\n\x1borg.tensorflow.util.testlogB\rTestLogProtosP\x01\xf8\x01\x01\x62\x06proto3')
|
| 19 |
+
|
| 20 |
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
| 21 |
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xla.tsl.protobuf.test_log_pb2', globals())
|
| 22 |
+
if _descriptor._USE_C_DESCRIPTORS == False:
|
| 23 |
+
|
| 24 |
+
DESCRIPTOR._options = None
|
| 25 |
+
DESCRIPTOR._serialized_options = b'\n\033org.tensorflow.util.testlogB\rTestLogProtosP\001\370\001\001'
|
| 26 |
+
_BENCHMARKENTRY_EXTRASENTRY._options = None
|
| 27 |
+
_BENCHMARKENTRY_EXTRASENTRY._serialized_options = b'8\001'
|
| 28 |
+
_CPUINFO_CACHESIZEENTRY._options = None
|
| 29 |
+
_CPUINFO_CACHESIZEENTRY._serialized_options = b'8\001'
|
| 30 |
+
_RUNCONFIGURATION_ENVVARSENTRY._options = None
|
| 31 |
+
_RUNCONFIGURATION_ENVVARSENTRY._serialized_options = b'8\001'
|
| 32 |
+
_ENTRYVALUE._serialized_start=106
|
| 33 |
+
_ENTRYVALUE._serialized_end=174
|
| 34 |
+
_METRICENTRY._serialized_start=177
|
| 35 |
+
_METRICENTRY._serialized_end=317
|
| 36 |
+
_BENCHMARKENTRY._serialized_start=320
|
| 37 |
+
_BENCHMARKENTRY._serialized_end=591
|
| 38 |
+
_BENCHMARKENTRY_EXTRASENTRY._serialized_start=522
|
| 39 |
+
_BENCHMARKENTRY_EXTRASENTRY._serialized_end=591
|
| 40 |
+
_BENCHMARKENTRIES._serialized_start=593
|
| 41 |
+
_BENCHMARKENTRIES._serialized_end=654
|
| 42 |
+
_BUILDCONFIGURATION._serialized_start=656
|
| 43 |
+
_BUILDCONFIGURATION._serialized_end=722
|
| 44 |
+
_COMMITID._serialized_start=724
|
| 45 |
+
_COMMITID._serialized_end=826
|
| 46 |
+
_CPUINFO._serialized_start=829
|
| 47 |
+
_CPUINFO._serialized_end=1051
|
| 48 |
+
_CPUINFO_CACHESIZEENTRY._serialized_start=1003
|
| 49 |
+
_CPUINFO_CACHESIZEENTRY._serialized_end=1051
|
| 50 |
+
_MEMORYINFO._serialized_start=1053
|
| 51 |
+
_MEMORYINFO._serialized_end=1099
|
| 52 |
+
_GPUINFO._serialized_start=1101
|
| 53 |
+
_GPUINFO._serialized_end=1155
|
| 54 |
+
_PLATFORMINFO._serialized_start=1157
|
| 55 |
+
_PLATFORMINFO._serialized_end=1269
|
| 56 |
+
_AVAILABLEDEVICEINFO._serialized_start=1271
|
| 57 |
+
_AVAILABLEDEVICEINFO._serialized_end=1372
|
| 58 |
+
_MACHINECONFIGURATION._serialized_start=1375
|
| 59 |
+
_MACHINECONFIGURATION._serialized_end=1682
|
| 60 |
+
_RUNCONFIGURATION._serialized_start=1685
|
| 61 |
+
_RUNCONFIGURATION._serialized_end=1830
|
| 62 |
+
_RUNCONFIGURATION_ENVVARSENTRY._serialized_start=1784
|
| 63 |
+
_RUNCONFIGURATION_ENVVARSENTRY._serialized_end=1830
|
| 64 |
+
_TESTRESULTS._serialized_start=1833
|
| 65 |
+
_TESTRESULTS._serialized_end=2425
|
| 66 |
+
_TESTRESULTS_BENCHMARKTYPE._serialized_start=2289
|
| 67 |
+
_TESTRESULTS_BENCHMARKTYPE._serialized_end=2425
|
| 68 |
+
# @@protoc_insertion_point(module_scope)
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/compiler/xla/xla_data_pb2.py
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
| 3 |
+
# source: xla/xla_data.proto
|
| 4 |
+
"""Generated protocol buffer code."""
|
| 5 |
+
from google.protobuf.internal import builder as _builder
|
| 6 |
+
from google.protobuf import descriptor as _descriptor
|
| 7 |
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
| 8 |
+
from google.protobuf import symbol_database as _symbol_database
|
| 9 |
+
# @@protoc_insertion_point(imports)
|
| 10 |
+
|
| 11 |
+
_sym_db = _symbol_database.Default()
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12xla/xla_data.proto\x12\x03xla\"\xb7\x01\n\rPaddingConfig\x12=\n\ndimensions\x18\x01 \x03(\x0b\x32).xla.PaddingConfig.PaddingConfigDimension\x1ag\n\x16PaddingConfigDimension\x12\x18\n\x10\x65\x64ge_padding_low\x18\x01 \x01(\x03\x12\x19\n\x11\x65\x64ge_padding_high\x18\x02 \x01(\x03\x12\x18\n\x10interior_padding\x18\x03 \x01(\x03\"\x1f\n\tTileProto\x12\x12\n\ndimensions\x18\x01 \x03(\x03\"<\n\x10SplitConfigProto\x12\x11\n\tdimension\x18\x01 \x01(\x03\x12\x15\n\rsplit_indices\x18\x02 \x03(\x03\"\xba\x04\n\x0bLayoutProto\x12*\n\x0f\x64im_level_types\x18\t \x03(\x0e\x32\x11.xla.DimLevelType\x12\x12\n\ndim_unique\x18\r \x03(\x08\x12\x13\n\x0b\x64im_ordered\x18\x0e \x03(\x08\x12\x16\n\x0eminor_to_major\x18\x01 \x03(\x03\x12\x1d\n\x05tiles\x18\x06 \x03(\x0b\x32\x0e.xla.TileProto\x12*\n\"tail_padding_alignment_in_elements\x18\x10 \x01(\x03\x12\x1c\n\x14\x65lement_size_in_bits\x18\x07 \x01(\x03\x12\x14\n\x0cmemory_space\x18\x08 \x01(\x03\x12\x30\n\x14index_primitive_type\x18\x0b \x01(\x0e\x32\x12.xla.PrimitiveType\x12\x32\n\x16pointer_primitive_type\x18\x0c \x01(\x0e\x32\x12.xla.PrimitiveType\x12\'\n\x0ephysical_shape\x18\n \x01(\x0b\x32\x0f.xla.ShapeProto\x12+\n#dynamic_shape_metadata_prefix_bytes\x18\x0f \x01(\x03\x12,\n\rsplit_configs\x18\x11 \x03(\x0b\x32\x15.xla.SplitConfigProtoJ\x04\x08\x02\x10\x03J\x04\x08\x03\x10\x04J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06R\x11padded_dimensionsR\rpadding_valueR\x06\x66ormatR\x13max_sparse_elements\"\xbd\x01\n\nShapeProto\x12(\n\x0c\x65lement_type\x18\x02 \x01(\x0e\x32\x12.xla.PrimitiveType\x12\x12\n\ndimensions\x18\x03 \x03(\x03\x12%\n\x0ctuple_shapes\x18\x04 \x03(\x0b\x32\x0f.xla.ShapeProto\x12 \n\x06layout\x18\x05 \x01(\x0b\x32\x10.xla.LayoutProto\x12\x1c\n\x14is_dynamic_dimension\x18\x06 \x03(\x08J\x04\x08\x01\x10\x02R\x04rank\"r\n\x11ProgramShapeProto\x12#\n\nparameters\x18\x01 \x03(\x0b\x32\x0f.xla.ShapeProto\x12\x1f\n\x06result\x18\x02 \x01(\x0b\x32\x0f.xla.ShapeProto\x12\x17\n\x0fparameter_names\x18\x03 \x03(\t\"D\n\x10\x43omputationStats\x12\x12\n\nflop_count\x18\x01 \x01(\x01\x12\x1c\n\x14transcendental_count\x18\x02 \x01(\x01\"\xe0\x04\n\nOpMetadata\x12\x0f\n\x07op_type\x18\x01 \x01(\t\x12\x0f\n\x07op_name\x18\x02 \x01(\t\x12\x13\n\x0bsource_file\x18\x03 \x01(\t\x12\x13\n\x0bsource_line\x18\x04 \x01(\x05\x12*\n\x0cprofile_type\x18\x05 \x03(\x0e\x32\x10.xla.ProfileTypeB\x02\x18\x01\x12\'\n\x1fsize_of_generated_code_in_bytes\x18\x08 \x01(\x03\x12+\n#size_of_memory_working_set_in_bytes\x18\t \x01(\x03\x12\x31\n\x0cprofile_info\x18\n \x01(\x0b\x32\x1b.xla.OpMetadata.ProfileInfo\x12\x19\n\x11\x64\x65\x64uplicated_name\x18\x0c \x01(\t\x12\x17\n\x0fpreserve_layout\x18\r \x01(\x08\x12\x16\n\x0estack_frame_id\x18\x0f \x01(\x05\x12\x17\n\x0fscheduling_name\x18\x10 \x01(\t\x1a\xad\x01\n\x0bProfileInfo\x12&\n\x0cprofile_type\x18\x01 \x03(\x0e\x32\x10.xla.ProfileType\x12\x18\n\x10relative_speedup\x18\x02 \x01(\x01\x12*\n\x0eprofile_source\x18\x03 \x01(\x0e\x32\x12.xla.ProfileSource\x12\x30\n\x11\x63ompilation_event\x18\x04 \x01(\x0e\x32\x15.xla.CompilationEventJ\x04\x08\x06\x10\x07J\x04\x08\x07\x10\x08J\x04\x08\x0e\x10\x0fR\x10\x63reation_pass_idR\x18logical_creation_pass_id\"\x80\x02\n\x10\x45xecutionProfile\x12\x1d\n\x15\x63ompilation_cache_hit\x18\x01 \x01(\x08\x12\x17\n\x0f\x63ompile_time_ms\x18\x02 \x01(\x03\x12\x1b\n\x13\x63ompute_cycle_count\x18\x03 \x01(\x03\x12\x17\n\x0f\x63ompute_time_ns\x18\x04 \x01(\x03\x12$\n\x1c\x63ompute_and_transfer_time_ns\x18\x05 \x01(\x03\x12 \n\x18\x65xecutable_size_in_bytes\x18\x06 \x01(\x03\x12\x19\n\x11profile_cache_hit\x18\x07 \x01(\x08\x12\x1b\n\x13warmup_run_executed\x18\x08 \x01(\x08\"!\n\x0f\x45xecutionHandle\x12\x0e\n\x06handle\x18\x01 \x01(\x03\"\"\n\x10GlobalDataHandle\x12\x0e\n\x06handle\x18\x01 \x01(\x03\"4\n\x0c\x44\x65viceHandle\x12\x0e\n\x06handle\x18\x01 \x01(\x03\x12\x14\n\x0c\x64\x65vice_count\x18\x02 \x01(\x03\"\xb4\x01\n\rChannelHandle\x12\x0e\n\x06handle\x18\x01 \x01(\x03\x12,\n\x04type\x18\x02 \x01(\x0e\x32\x1e.xla.ChannelHandle.ChannelType\"e\n\x0b\x43hannelType\x12\x18\n\x14\x43HANNEL_TYPE_INVALID\x10\x00\x12\x14\n\x10\x44\x45VICE_TO_DEVICE\x10\x01\x12\x12\n\x0e\x44\x45VICE_TO_HOST\x10\x02\x12\x12\n\x0eHOST_TO_DEVICE\x10\x03\"\xc5\x01\n\x15\x44\x65viceAssignmentProto\x12\x15\n\rreplica_count\x18\x01 \x01(\x05\x12\x19\n\x11\x63omputation_count\x18\x02 \x01(\x05\x12I\n\x13\x63omputation_devices\x18\x03 \x03(\x0b\x32,.xla.DeviceAssignmentProto.ComputationDevice\x1a/\n\x11\x43omputationDevice\x12\x1a\n\x12replica_device_ids\x18\x01 \x03(\x03\"\xde\x03\n\x0cLiteralProto\x12\x1e\n\x05shape\x18\x01 \x01(\x0b\x32\x0f.xla.ShapeProto\x12\r\n\x05preds\x18\x02 \x03(\x08\x12\x0b\n\x03s2s\x18\x1a \x01(\x0c\x12\x0b\n\x03s4s\x18\x15 \x01(\x0c\x12\x0b\n\x03s8s\x18\x0f \x01(\x0c\x12\x0b\n\x03u2s\x18\x1b \x01(\x0c\x12\x0b\n\x03u4s\x18\x16 \x01(\x0c\x12\x0b\n\x03u8s\x18\x03 \x01(\x0c\x12\x0c\n\x04s32s\x18\x04 \x03(\x05\x12\x0c\n\x04s64s\x18\x05 \x03(\x03\x12\x0c\n\x04u32s\x18\x06 \x03(\r\x12\x0c\n\x04u64s\x18\x07 \x03(\x04\x12\x0c\n\x04\x66\x33\x32s\x18\x08 \x03(\x02\x12\x0c\n\x04\x66\x36\x34s\x18\t \x03(\x01\x12\x0c\n\x04\x63\x36\x34s\x18\x0c \x03(\x02\x12\r\n\x05\x63\x31\x32\x38s\x18\x12 \x03(\x01\x12)\n\x0etuple_literals\x18\n \x03(\x0b\x32\x11.xla.LiteralProto\x12\x0c\n\x04\x66\x31\x36s\x18\x0b \x01(\x0c\x12\r\n\x05\x62\x66\x31\x36s\x18\r \x01(\x0c\x12\x0c\n\x04u16s\x18\x10 \x01(\x0c\x12\x0c\n\x04s16s\x18\x11 \x01(\x0c\x12\x0f\n\x07\x66\x38\x65\x35m2s\x18\x13 \x01(\x0c\x12\x11\n\tf8e4m3fns\x18\x14 \x01(\x0c\x12\x16\n\x0e\x66\x38\x65\x34m3b11fnuzs\x18\x17 \x01(\x0c\x12\x13\n\x0b\x66\x38\x65\x35m2fnuzs\x18\x18 \x01(\x0c\x12\x13\n\x0b\x66\x38\x65\x34m3fnuzs\x18\x19 \x01(\x0c\x12\x16\n\x0esparse_indices\x18\x0e \x03(\x03\"\xa3\x01\n\x0fWindowDimension\x12\x0c\n\x04size\x18\x01 \x01(\x03\x12\x0e\n\x06stride\x18\x02 \x01(\x03\x12\x13\n\x0bpadding_low\x18\x03 \x01(\x03\x12\x14\n\x0cpadding_high\x18\x04 \x01(\x03\x12\x17\n\x0fwindow_dilation\x18\x05 \x01(\x03\x12\x15\n\rbase_dilation\x18\x06 \x01(\x03\x12\x17\n\x0fwindow_reversal\x18\x07 \x01(\x08\"2\n\x06Window\x12(\n\ndimensions\x18\x01 \x03(\x0b\x32\x14.xla.WindowDimension\"\xc2\x01\n\x16GatherDimensionNumbers\x12\x13\n\x0boffset_dims\x18\x01 \x03(\x03\x12\x1c\n\x14\x63ollapsed_slice_dims\x18\x02 \x03(\x03\x12\x17\n\x0fstart_index_map\x18\x03 \x03(\x03\x12\x18\n\x10index_vector_dim\x18\x04 \x01(\x03\x12\x1d\n\x15operand_batching_dims\x18\x05 \x03(\x03\x12#\n\x1bstart_indices_batching_dims\x18\x06 \x03(\x03\"\xd7\x01\n\x17ScatterDimensionNumbers\x12\x1a\n\x12update_window_dims\x18\x01 \x03(\x03\x12\x1c\n\x14inserted_window_dims\x18\x02 \x03(\x03\x12$\n\x1cscatter_dims_to_operand_dims\x18\x03 \x03(\x03\x12\x18\n\x10index_vector_dim\x18\x04 \x01(\x03\x12\x1b\n\x13input_batching_dims\x18\x05 \x03(\x03\x12%\n\x1dscatter_indices_batching_dims\x18\x06 \x03(\x03\"\xd8\x02\n\x1b\x43onvolutionDimensionNumbers\x12\x1d\n\x15input_batch_dimension\x18\x07 \x01(\x03\x12\x1f\n\x17input_feature_dimension\x18\x08 \x01(\x03\x12 \n\x18input_spatial_dimensions\x18\x0b \x03(\x03\x12&\n\x1ekernel_input_feature_dimension\x18\x03 \x01(\x03\x12\'\n\x1fkernel_output_feature_dimension\x18\x04 \x01(\x03\x12!\n\x19kernel_spatial_dimensions\x18\x06 \x03(\x03\x12\x1e\n\x16output_batch_dimension\x18\t \x01(\x03\x12 \n\x18output_feature_dimension\x18\n \x01(\x03\x12!\n\x19output_spatial_dimensions\x18\x0c \x03(\x03\"\x99\x01\n\x13\x44otDimensionNumbers\x12\"\n\x1alhs_contracting_dimensions\x18\x01 \x03(\x03\x12\"\n\x1arhs_contracting_dimensions\x18\x02 \x03(\x03\x12\x1c\n\x14lhs_batch_dimensions\x18\x03 \x03(\x03\x12\x1c\n\x14rhs_batch_dimensions\x18\x04 \x03(\x03\"m\n\x12SparsityDescriptor\x12\x1f\n\x04type\x18\x01 \x01(\x0e\x32\x11.xla.SparsityType\x12\r\n\x05index\x18\x02 \x01(\x05\x12\x11\n\tdimension\x18\x03 \x01(\x05\x12\t\n\x01n\x18\x04 \x01(\x05\x12\t\n\x01m\x18\x05 \x01(\x05\"\xdf\x01\n\x16TriangularSolveOptions\x12\x11\n\tleft_side\x18\x01 \x01(\x08\x12\r\n\x05lower\x18\x02 \x01(\x08\x12\x15\n\runit_diagonal\x18\x03 \x01(\x08\x12:\n\x0btranspose_a\x18\x04 \x01(\x0e\x32%.xla.TriangularSolveOptions.Transpose\"P\n\tTranspose\x12\x15\n\x11TRANSPOSE_INVALID\x10\x00\x12\x10\n\x0cNO_TRANSPOSE\x10\x01\x12\r\n\tTRANSPOSE\x10\x02\x12\x0b\n\x07\x41\x44JOINT\x10\x03\" \n\x0f\x43holeskyOptions\x12\r\n\x05lower\x18\x01 \x01(\x08\"!\n\x0bSortOptions\x12\x12\n\ndescending\x18\x01 \x01(\x08\"o\n\x12\x46rontendAttributes\x12-\n\x03map\x18\x01 \x03(\x0b\x32 .xla.FrontendAttributes.MapEntry\x1a*\n\x08MapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"0\n\tStatistic\x12\x11\n\tstat_name\x18\x01 \x01(\t\x12\x10\n\x08stat_val\x18\x02 \x01(\x01\"T\n\rStatisticsViz\x12\x1f\n\x17stat_index_to_visualize\x18\x01 \x01(\x03\x12\"\n\nstatistics\x18\x02 \x03(\x0b\x32\x0e.xla.Statistic\"\xd3\x04\n\nOpSharding\x12\"\n\x04type\x18\x01 \x01(\x0e\x32\x14.xla.OpSharding.Type\x12#\n\ntile_shape\x18\x02 \x01(\x0b\x32\x0f.xla.ShapeProto\x12\"\n\x1atile_assignment_dimensions\x18\x03 \x03(\x03\x12\x1f\n\x17tile_assignment_devices\x18\x04 \x03(\x03\x12(\n\x0ftuple_shardings\x18\x05 \x03(\x0b\x32\x0f.xla.OpSharding\x12\"\n\x1areplicate_on_last_tile_dim\x18\x06 \x01(\x08\x12!\n\x08metadata\x18\x07 \x03(\x0b\x32\x0f.xla.OpMetadata\x12,\n\x0elast_tile_dims\x18\x08 \x03(\x0e\x32\x14.xla.OpSharding.Type\x12\x19\n\x11iota_reshape_dims\x18\t \x03(\x03\x12\x1b\n\x13iota_transpose_perm\x18\n \x03(\x05\x12\x16\n\x0eis_shard_group\x18\x0b \x01(\x08\x12\x16\n\x0eshard_group_id\x18\x0c \x01(\x03\x12\x38\n\x10shard_group_type\x18\r \x01(\x0e\x32\x1e.xla.OpSharding.ShardGroupType\"R\n\x04Type\x12\x0e\n\nREPLICATED\x10\x00\x12\x0b\n\x07MAXIMAL\x10\x01\x12\t\n\x05TUPLE\x10\x02\x12\t\n\x05OTHER\x10\x03\x12\n\n\x06MANUAL\x10\x04\x12\x0b\n\x07UNKNOWN\x10\x05\"\"\n\x0eShardGroupType\x12\x06\n\x02\x41S\x10\x00\x12\x08\n\x04LIKE\x10\x01\"#\n\x0cReplicaGroup\x12\x13\n\x0breplica_ids\x18\x01 \x03(\x03\"\x8e\x01\n\x19IotaReplicaGroupListProto\x12\x1a\n\x12num_replica_groups\x18\x01 \x01(\x03\x12\x1d\n\x15num_devices_per_group\x18\x02 \x01(\x03\x12\x19\n\x11iota_reshape_dims\x18\x03 \x03(\x03\x12\x1b\n\x13iota_transpose_perm\x18\x04 \x03(\x05\"\x87\x01\n\x19\x43ollectiveDeviceListProto\x12)\n\x0ereplica_groups\x18\x01 \x03(\x0b\x32\x11.xla.ReplicaGroup\x12?\n\x17iota_replica_group_list\x18\x02 \x01(\x0b\x32\x1e.xla.IotaReplicaGroupListProto\".\n\x0cSourceTarget\x12\x0e\n\x06source\x18\x01 \x01(\x03\x12\x0e\n\x06target\x18\x02 \x01(\x03\"\xb9\x04\n\x0fPrecisionConfig\x12\x39\n\x11operand_precision\x18\x01 \x03(\x0e\x32\x1e.xla.PrecisionConfig.Precision\x12\x31\n\talgorithm\x18\x02 \x01(\x0e\x32\x1e.xla.PrecisionConfig.Algorithm\"B\n\tPrecision\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x08\n\x04HIGH\x10\x01\x12\x0b\n\x07HIGHEST\x10\x02\x12\x11\n\rPACKED_NIBBLE\x10\x03\"\xf3\x02\n\tAlgorithm\x12\r\n\tALG_UNSET\x10\x00\x12\x1d\n\x19\x41LG_DOT_ANY_F8_ANY_F8_F32\x10\x01\x12(\n$ALG_DOT_ANY_F8_ANY_F8_F32_FAST_ACCUM\x10\x02\x12\x17\n\x13\x41LG_DOT_F16_F16_F16\x10\x03\x12\x17\n\x13\x41LG_DOT_F16_F16_F32\x10\x04\x12\x1a\n\x16\x41LG_DOT_BF16_BF16_BF16\x10\x05\x12\x19\n\x15\x41LG_DOT_BF16_BF16_F32\x10\x06\x12\x1c\n\x18\x41LG_DOT_BF16_BF16_F32_X3\x10\x07\x12\x1c\n\x18\x41LG_DOT_BF16_BF16_F32_X6\x10\x08\x12\x19\n\x15\x41LG_DOT_TF32_TF32_F32\x10\t\x12\x1c\n\x18\x41LG_DOT_TF32_TF32_F32_X3\x10\n\x12\x17\n\x13\x41LG_DOT_F32_F32_F32\x10\x0b\x12\x17\n\x13\x41LG_DOT_F64_F64_F64\x10\x0c\":\n\x14ParameterReplication\x12\"\n\x1areplicated_at_leaf_buffers\x18\x01 \x03(\x08\"{\n\x16WhileLoopBackendConfig\x12\x44\n\x10known_trip_count\x18\x01 \x01(\x0b\x32*.xla.WhileLoopBackendConfig.KnownTripCount\x1a\x1b\n\x0eKnownTripCount\x12\t\n\x01n\x18\x01 \x01(\x03\"g\n\x15OutputOperandAliasing\x12\x1a\n\x12output_shape_index\x18\x01 \x03(\x03\x12\x15\n\roperand_index\x18\x02 \x01(\x03\x12\x1b\n\x13operand_shape_index\x18\x03 \x03(\x03\"]\n\x12OriginalArrayProto\x12\x18\n\x10leaf_shape_index\x18\x01 \x03(\x03\x12\x18\n\x10instruction_name\x18\x02 \x01(\t\x12\x13\n\x0bshape_index\x18\x03 \x03(\x03\"=\n\x12OriginalValueProto\x12\'\n\x06leaves\x18\x01 \x03(\x0b\x32\x17.xla.OriginalArrayProto*\xc7\x02\n\rPrimitiveType\x12\x1a\n\x16PRIMITIVE_TYPE_INVALID\x10\x00\x12\x08\n\x04PRED\x10\x01\x12\x06\n\x02S2\x10\x1a\x12\x06\n\x02S4\x10\x15\x12\x06\n\x02S8\x10\x02\x12\x07\n\x03S16\x10\x03\x12\x07\n\x03S32\x10\x04\x12\x07\n\x03S64\x10\x05\x12\x06\n\x02U2\x10\x1b\x12\x06\n\x02U4\x10\x16\x12\x06\n\x02U8\x10\x06\x12\x07\n\x03U16\x10\x07\x12\x07\n\x03U32\x10\x08\x12\x07\n\x03U64\x10\t\x12\x07\n\x03\x46\x31\x36\x10\n\x12\x07\n\x03\x46\x33\x32\x10\x0b\x12\x08\n\x04\x42\x46\x31\x36\x10\x10\x12\x07\n\x03\x46\x36\x34\x10\x0c\x12\n\n\x06\x46\x38\x45\x35M2\x10\x13\x12\x0c\n\x08\x46\x38\x45\x34M3FN\x10\x14\x12\x11\n\rF8E4M3B11FNUZ\x10\x17\x12\x0e\n\nF8E5M2FNUZ\x10\x18\x12\x0e\n\nF8E4M3FNUZ\x10\x19\x12\x07\n\x03\x43\x36\x34\x10\x0f\x12\x08\n\x04\x43\x31\x32\x38\x10\x12\x12\t\n\x05TUPLE\x10\r\x12\x0f\n\x0bOPAQUE_TYPE\x10\x0e\x12\t\n\x05TOKEN\x10\x11*^\n\x0c\x44imLevelType\x12\r\n\tDIM_DENSE\x10\x00\x12\x12\n\x0e\x44IM_COMPRESSED\x10\x01\x12\x11\n\rDIM_SINGLETON\x10\x02\x12\x18\n\x14\x44IM_LOOSE_COMPRESSED\x10\x03*=\n\x0bProfileType\x12\x0b\n\x07INVALID\x10\x00\x12\n\n\x06WINDOW\x10\x01\x12\x08\n\x04\x46LAG\x10\x02\x12\x0b\n\x07INTEGER\x10\x03*j\n\rProfileSource\x12!\n\x1dPROFILE_SOURCE_UNKNOWN_SOURCE\x10\x00\x12\x1b\n\x17PROFILE_SOURCE_EMBEDDED\x10\x01\x12\x19\n\x15PROFILE_SOURCE_REMOTE\x10\x02*\x85\x01\n\x10\x43ompilationEvent\x12#\n\x1f\x43OMPILATION_EVENT_UNKNOWN_EVENT\x10\x00\x12\'\n#COMPILATION_EVENT_FIRST_COMPILATION\x10\x01\x12#\n\x1f\x43OMPILATION_EVENT_RECOMPILATION\x10\x02*G\n\x0bPaddingType\x12\x13\n\x0fPADDING_INVALID\x10\x00\x12\x11\n\rPADDING_VALID\x10\x01\x12\x10\n\x0cPADDING_SAME\x10\x02*1\n\x07\x46\x66tType\x12\x07\n\x03\x46\x46T\x10\x00\x12\x08\n\x04IFFT\x10\x01\x12\x08\n\x04RFFT\x10\x02\x12\t\n\x05IRFFT\x10\x03*A\n\x0cSparsityType\x12\x14\n\x10SPARSITY_INVALID\x10\x00\x12\x1b\n\x17SPARSITY_STRUCTURED_N_M\x10\x01*F\n\x12RandomDistribution\x12\x0f\n\x0bRNG_INVALID\x10\x00\x12\x0f\n\x0bRNG_UNIFORM\x10\x01\x12\x0e\n\nRNG_NORMAL\x10\x02*E\n\x0fRandomAlgorithm\x12\x0f\n\x0bRNG_DEFAULT\x10\x00\x12\x11\n\rRNG_THREE_FRY\x10\x01\x12\x0e\n\nRNG_PHILOX\x10\x02\x42\x03\xf8\x01\x01\x62\x06proto3')
|
| 17 |
+
|
| 18 |
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
| 19 |
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xla.xla_data_pb2', globals())
|
| 20 |
+
if _descriptor._USE_C_DESCRIPTORS == False:
|
| 21 |
+
|
| 22 |
+
DESCRIPTOR._options = None
|
| 23 |
+
DESCRIPTOR._serialized_options = b'\370\001\001'
|
| 24 |
+
_OPMETADATA.fields_by_name['profile_type']._options = None
|
| 25 |
+
_OPMETADATA.fields_by_name['profile_type']._serialized_options = b'\030\001'
|
| 26 |
+
_FRONTENDATTRIBUTES_MAPENTRY._options = None
|
| 27 |
+
_FRONTENDATTRIBUTES_MAPENTRY._serialized_options = b'8\001'
|
| 28 |
+
_PRIMITIVETYPE._serialized_start=6896
|
| 29 |
+
_PRIMITIVETYPE._serialized_end=7223
|
| 30 |
+
_DIMLEVELTYPE._serialized_start=7225
|
| 31 |
+
_DIMLEVELTYPE._serialized_end=7319
|
| 32 |
+
_PROFILETYPE._serialized_start=7321
|
| 33 |
+
_PROFILETYPE._serialized_end=7382
|
| 34 |
+
_PROFILESOURCE._serialized_start=7384
|
| 35 |
+
_PROFILESOURCE._serialized_end=7490
|
| 36 |
+
_COMPILATIONEVENT._serialized_start=7493
|
| 37 |
+
_COMPILATIONEVENT._serialized_end=7626
|
| 38 |
+
_PADDINGTYPE._serialized_start=7628
|
| 39 |
+
_PADDINGTYPE._serialized_end=7699
|
| 40 |
+
_FFTTYPE._serialized_start=7701
|
| 41 |
+
_FFTTYPE._serialized_end=7750
|
| 42 |
+
_SPARSITYTYPE._serialized_start=7752
|
| 43 |
+
_SPARSITYTYPE._serialized_end=7817
|
| 44 |
+
_RANDOMDISTRIBUTION._serialized_start=7819
|
| 45 |
+
_RANDOMDISTRIBUTION._serialized_end=7889
|
| 46 |
+
_RANDOMALGORITHM._serialized_start=7891
|
| 47 |
+
_RANDOMALGORITHM._serialized_end=7960
|
| 48 |
+
_PADDINGCONFIG._serialized_start=28
|
| 49 |
+
_PADDINGCONFIG._serialized_end=211
|
| 50 |
+
_PADDINGCONFIG_PADDINGCONFIGDIMENSION._serialized_start=108
|
| 51 |
+
_PADDINGCONFIG_PADDINGCONFIGDIMENSION._serialized_end=211
|
| 52 |
+
_TILEPROTO._serialized_start=213
|
| 53 |
+
_TILEPROTO._serialized_end=244
|
| 54 |
+
_SPLITCONFIGPROTO._serialized_start=246
|
| 55 |
+
_SPLITCONFIGPROTO._serialized_end=306
|
| 56 |
+
_LAYOUTPROTO._serialized_start=309
|
| 57 |
+
_LAYOUTPROTO._serialized_end=879
|
| 58 |
+
_SHAPEPROTO._serialized_start=882
|
| 59 |
+
_SHAPEPROTO._serialized_end=1071
|
| 60 |
+
_PROGRAMSHAPEPROTO._serialized_start=1073
|
| 61 |
+
_PROGRAMSHAPEPROTO._serialized_end=1187
|
| 62 |
+
_COMPUTATIONSTATS._serialized_start=1189
|
| 63 |
+
_COMPUTATIONSTATS._serialized_end=1257
|
| 64 |
+
_OPMETADATA._serialized_start=1260
|
| 65 |
+
_OPMETADATA._serialized_end=1868
|
| 66 |
+
_OPMETADATA_PROFILEINFO._serialized_start=1633
|
| 67 |
+
_OPMETADATA_PROFILEINFO._serialized_end=1806
|
| 68 |
+
_EXECUTIONPROFILE._serialized_start=1871
|
| 69 |
+
_EXECUTIONPROFILE._serialized_end=2127
|
| 70 |
+
_EXECUTIONHANDLE._serialized_start=2129
|
| 71 |
+
_EXECUTIONHANDLE._serialized_end=2162
|
| 72 |
+
_GLOBALDATAHANDLE._serialized_start=2164
|
| 73 |
+
_GLOBALDATAHANDLE._serialized_end=2198
|
| 74 |
+
_DEVICEHANDLE._serialized_start=2200
|
| 75 |
+
_DEVICEHANDLE._serialized_end=2252
|
| 76 |
+
_CHANNELHANDLE._serialized_start=2255
|
| 77 |
+
_CHANNELHANDLE._serialized_end=2435
|
| 78 |
+
_CHANNELHANDLE_CHANNELTYPE._serialized_start=2334
|
| 79 |
+
_CHANNELHANDLE_CHANNELTYPE._serialized_end=2435
|
| 80 |
+
_DEVICEASSIGNMENTPROTO._serialized_start=2438
|
| 81 |
+
_DEVICEASSIGNMENTPROTO._serialized_end=2635
|
| 82 |
+
_DEVICEASSIGNMENTPROTO_COMPUTATIONDEVICE._serialized_start=2588
|
| 83 |
+
_DEVICEASSIGNMENTPROTO_COMPUTATIONDEVICE._serialized_end=2635
|
| 84 |
+
_LITERALPROTO._serialized_start=2638
|
| 85 |
+
_LITERALPROTO._serialized_end=3116
|
| 86 |
+
_WINDOWDIMENSION._serialized_start=3119
|
| 87 |
+
_WINDOWDIMENSION._serialized_end=3282
|
| 88 |
+
_WINDOW._serialized_start=3284
|
| 89 |
+
_WINDOW._serialized_end=3334
|
| 90 |
+
_GATHERDIMENSIONNUMBERS._serialized_start=3337
|
| 91 |
+
_GATHERDIMENSIONNUMBERS._serialized_end=3531
|
| 92 |
+
_SCATTERDIMENSIONNUMBERS._serialized_start=3534
|
| 93 |
+
_SCATTERDIMENSIONNUMBERS._serialized_end=3749
|
| 94 |
+
_CONVOLUTIONDIMENSIONNUMBERS._serialized_start=3752
|
| 95 |
+
_CONVOLUTIONDIMENSIONNUMBERS._serialized_end=4096
|
| 96 |
+
_DOTDIMENSIONNUMBERS._serialized_start=4099
|
| 97 |
+
_DOTDIMENSIONNUMBERS._serialized_end=4252
|
| 98 |
+
_SPARSITYDESCRIPTOR._serialized_start=4254
|
| 99 |
+
_SPARSITYDESCRIPTOR._serialized_end=4363
|
| 100 |
+
_TRIANGULARSOLVEOPTIONS._serialized_start=4366
|
| 101 |
+
_TRIANGULARSOLVEOPTIONS._serialized_end=4589
|
| 102 |
+
_TRIANGULARSOLVEOPTIONS_TRANSPOSE._serialized_start=4509
|
| 103 |
+
_TRIANGULARSOLVEOPTIONS_TRANSPOSE._serialized_end=4589
|
| 104 |
+
_CHOLESKYOPTIONS._serialized_start=4591
|
| 105 |
+
_CHOLESKYOPTIONS._serialized_end=4623
|
| 106 |
+
_SORTOPTIONS._serialized_start=4625
|
| 107 |
+
_SORTOPTIONS._serialized_end=4658
|
| 108 |
+
_FRONTENDATTRIBUTES._serialized_start=4660
|
| 109 |
+
_FRONTENDATTRIBUTES._serialized_end=4771
|
| 110 |
+
_FRONTENDATTRIBUTES_MAPENTRY._serialized_start=4729
|
| 111 |
+
_FRONTENDATTRIBUTES_MAPENTRY._serialized_end=4771
|
| 112 |
+
_STATISTIC._serialized_start=4773
|
| 113 |
+
_STATISTIC._serialized_end=4821
|
| 114 |
+
_STATISTICSVIZ._serialized_start=4823
|
| 115 |
+
_STATISTICSVIZ._serialized_end=4907
|
| 116 |
+
_OPSHARDING._serialized_start=4910
|
| 117 |
+
_OPSHARDING._serialized_end=5505
|
| 118 |
+
_OPSHARDING_TYPE._serialized_start=5387
|
| 119 |
+
_OPSHARDING_TYPE._serialized_end=5469
|
| 120 |
+
_OPSHARDING_SHARDGROUPTYPE._serialized_start=5471
|
| 121 |
+
_OPSHARDING_SHARDGROUPTYPE._serialized_end=5505
|
| 122 |
+
_REPLICAGROUP._serialized_start=5507
|
| 123 |
+
_REPLICAGROUP._serialized_end=5542
|
| 124 |
+
_IOTAREPLICAGROUPLISTPROTO._serialized_start=5545
|
| 125 |
+
_IOTAREPLICAGROUPLISTPROTO._serialized_end=5687
|
| 126 |
+
_COLLECTIVEDEVICELISTPROTO._serialized_start=5690
|
| 127 |
+
_COLLECTIVEDEVICELISTPROTO._serialized_end=5825
|
| 128 |
+
_SOURCETARGET._serialized_start=5827
|
| 129 |
+
_SOURCETARGET._serialized_end=5873
|
| 130 |
+
_PRECISIONCONFIG._serialized_start=5876
|
| 131 |
+
_PRECISIONCONFIG._serialized_end=6445
|
| 132 |
+
_PRECISIONCONFIG_PRECISION._serialized_start=6005
|
| 133 |
+
_PRECISIONCONFIG_PRECISION._serialized_end=6071
|
| 134 |
+
_PRECISIONCONFIG_ALGORITHM._serialized_start=6074
|
| 135 |
+
_PRECISIONCONFIG_ALGORITHM._serialized_end=6445
|
| 136 |
+
_PARAMETERREPLICATION._serialized_start=6447
|
| 137 |
+
_PARAMETERREPLICATION._serialized_end=6505
|
| 138 |
+
_WHILELOOPBACKENDCONFIG._serialized_start=6507
|
| 139 |
+
_WHILELOOPBACKENDCONFIG._serialized_end=6630
|
| 140 |
+
_WHILELOOPBACKENDCONFIG_KNOWNTRIPCOUNT._serialized_start=6603
|
| 141 |
+
_WHILELOOPBACKENDCONFIG_KNOWNTRIPCOUNT._serialized_end=6630
|
| 142 |
+
_OUTPUTOPERANDALIASING._serialized_start=6632
|
| 143 |
+
_OUTPUTOPERANDALIASING._serialized_end=6735
|
| 144 |
+
_ORIGINALARRAYPROTO._serialized_start=6737
|
| 145 |
+
_ORIGINALARRAYPROTO._serialized_end=6830
|
| 146 |
+
_ORIGINALVALUEPROTO._serialized_start=6832
|
| 147 |
+
_ORIGINALVALUEPROTO._serialized_end=6893
|
| 148 |
+
# @@protoc_insertion_point(module_scope)
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/__init__.py
ADDED
|
File without changes
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (194 Bytes). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/proto/__init__.py
ADDED
|
File without changes
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/proto/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (200 Bytes). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/proto/__pycache__/layout_pb2.cpython-310.pyc
ADDED
|
Binary file (1.67 kB). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/proto/layout_pb2.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
| 3 |
+
# source: tensorflow/dtensor/proto/layout.proto
|
| 4 |
+
"""Generated protocol buffer code."""
|
| 5 |
+
from google.protobuf.internal import builder as _builder
|
| 6 |
+
from google.protobuf import descriptor as _descriptor
|
| 7 |
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
| 8 |
+
from google.protobuf import symbol_database as _symbol_database
|
| 9 |
+
# @@protoc_insertion_point(imports)
|
| 10 |
+
|
| 11 |
+
_sym_db = _symbol_database.Default()
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%tensorflow/dtensor/proto/layout.proto\x12\x12tensorflow.dtensor\"+\n\x0cShardingSpec\x12\x15\n\rsharding_spec\x18\x02 \x01(\tJ\x04\x08\x01\x10\x02\"0\n\x12MeshDimensionProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04size\x18\x02 \x01(\x03\"\xfb\x01\n\x0bLayoutProto\x12\x38\n\x0esharding_specs\x18\x01 \x03(\x0b\x32 .tensorflow.dtensor.ShardingSpec\x12\x32\n\x0bmesh_config\x18\x02 \x01(\x0b\x32\x1d.tensorflow.dtensor.MeshProto\x12\x38\n\x04type\x18\x03 \x01(\x0e\x32*.tensorflow.dtensor.LayoutProto.LayoutType\"D\n\nLayoutType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\n\n\x06STATIC\x10\x01\x12\n\n\x06PARTED\x10\x02\x12\x11\n\rSINGLE_DEVICE\x10\x03\"\xeb\x01\n\tMeshProto\x12?\n\x0fmesh_dimensions\x18\x01 \x03(\x0b\x32&.tensorflow.dtensor.MeshDimensionProto\x12\x19\n\x11global_device_ids\x18\x02 \x03(\x03\x12\x18\n\x10local_device_ids\x18\x04 \x03(\x03\x12\x15\n\rlocal_devices\x18\x05 \x03(\t\x12\x16\n\x0eglobal_devices\x18\x06 \x03(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x14\n\x0cuse_xla_spmd\x18\x07 \x01(\x08\x12\x15\n\rsingle_device\x18\x08 \x01(\tb\x06proto3')
|
| 17 |
+
|
| 18 |
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
| 19 |
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.dtensor.proto.layout_pb2', globals())
|
| 20 |
+
if _descriptor._USE_C_DESCRIPTORS == False:
|
| 21 |
+
|
| 22 |
+
DESCRIPTOR._options = None
|
| 23 |
+
_SHARDINGSPEC._serialized_start=61
|
| 24 |
+
_SHARDINGSPEC._serialized_end=104
|
| 25 |
+
_MESHDIMENSIONPROTO._serialized_start=106
|
| 26 |
+
_MESHDIMENSIONPROTO._serialized_end=154
|
| 27 |
+
_LAYOUTPROTO._serialized_start=157
|
| 28 |
+
_LAYOUTPROTO._serialized_end=408
|
| 29 |
+
_LAYOUTPROTO_LAYOUTTYPE._serialized_start=340
|
| 30 |
+
_LAYOUTPROTO_LAYOUTTYPE._serialized_end=408
|
| 31 |
+
_MESHPROTO._serialized_start=411
|
| 32 |
+
_MESHPROTO._serialized_end=646
|
| 33 |
+
# @@protoc_insertion_point(module_scope)
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/python/__init__.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2022 The TensorFlow Authors. All Rights Reserved.
|
| 2 |
+
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
+
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
# ==============================================================================
|
| 15 |
+
"""DTensor Python API."""
|
| 16 |
+
|
| 17 |
+
# This file is left empty intentionally.
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/python/__pycache__/d_checkpoint.cpython-310.pyc
ADDED
|
Binary file (13.5 kB). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/python/__pycache__/d_variable.cpython-310.pyc
ADDED
|
Binary file (6.66 kB). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/python/__pycache__/dtensor_device.cpython-310.pyc
ADDED
|
Binary file (14.1 kB). View file
|
|
|
SwarmUI/dlbackend/ComfyUI/venv/lib/python3.10/site-packages/tensorflow/dtensor/python/__pycache__/gen_dtensor_ops.cpython-310.pyc
ADDED
|
Binary file (16.7 kB). View file
|
|
|