This is a curated list of Swift for TensorFlow known issues and missing features. With every release, new issues are added and resolved issues are updated.
Legend:
- Notable issues are marked in bold.
- Issues under active development are marked with 🚧.
Please see the JIRA issue tracker for a full list of known issues.
- Marking stored properties as
@differentiable
may result in a crash. (TF-521) - Marking an intializer as
@differentiable
may result in a SIL verification error:operand of 'apply' doesn't match function input type
. (TF-526) - Defining custom derivatives for
@_alwaysEmitIntoClient
declarations results in a crash. (TF-545) - Differentiating struct initializers may result in a SIL verification
error:
substituted callee type does not match substitutions
. (TF-546)
-
Tensor
advanced indexing and striding are not supported on GPU.
- When a runtime error occurs or when you interrupt cell execution,
resources (e.g. host memory, GPU memory) do not get released. This can
lead to OOMs. (TF-338)
- Workaround: Restart the runtime (
Runtime > Restart Runtime
in the Colab menu bar) to release all the resources.
- Workaround: Restart the runtime (
- If the last statement on a cell evaluates to a struct that was defined in
the notebook, then you get an error ("use of undeclared type") instead of
seeing the value of the statement. (TF-125)
- Workaround: Wrap the last statement in
print()
.
- Workaround: Wrap the last statement in
- Using extensions to conform a type to a protocol (e.g.
extension MyType: MyProtocol { ... }
), often causes duplicate conformance errors. (TF-162)- Workaround: Add the conformance in the same cell where the type is defined.
- If a cell that declares a type executes twice, then it creates two
different types with the same name. Mixing these types can lead to
confusing error messages like
cannot convert value of type 'MyType' to expected argument type 'MyType'
. (TF-156)- Workaround: Re-run all cells that use the declared type, so that they use the new type.
- The autocomplete UI should show types and documentation. It should position your cursor in the first argument when you complete a function call.
- The
Differentiable
protocol'sallDifferentiableVariables
requirement should not have a setter. Do not use this directly through a generic type with aDifferentiable
conformance constraint. (TF-208)
- 🚧 Model checkpointing and serialization APIs are missing. (TF-388)
- TensorFlow runtime errors (e.g. shape mismatch errors) do not show useful source location information or useful stack traces. (TF-458)
- If you are using a CUDA build and you have an NVIDIA GPU with a compute capability other than 3.5 or 7.0, then you will experience a ~10 minute delay the first time you execute a TensorFlow operation, while TensorFlow compiles kernels for your GPU's compute capability. The program will not print anything out and it will appear to be frozen. (TF-461)
- There is a long latency when allocating a
Tensor
for the first time on GPUs. Subsequent allocations are normal speed. (TF-460) - TensorFlow runtime errors (e.g. shape mismatch errors) do not show useful source location information or useful stack traces. (TF-458)
- Many Keras layers remain to be implemented, help wanted! (swift-apis#54)
- Parameter sharing APIs (e.g. using the same
Tensor
weights in multiple layers) are missing. - The
Parameter
class does not yet conform toDifferentiable
, and is not recommended for general use. - The compiler errors displayed when a user-defined layer struct fails to
fully satisfy the requirements of the
Layer
protocol are unclear.
- 🚧 Differentiation does not yet support functions with control flow.
([TF-354])
- Conditionals are supported since 0.4 (apple/swift#25057).
- 🚧 Higher-order differentiation is not yet supported.
- Differentiating functions with respect to an
inout
parameter is not yet supported. (TF-357) - The compiler will only synthesize conformance requirements for
Differentiable
instruct
types. (TF-37) - The
@differentiable
attribute incorrectly passes type-checking in some cases, when an error should be produced. This leads to compiler crashes. (TF-449) -
The@differentiating
attribute leads to a compiler crash when the derivative function is defined in a generic context that is more constrained than the original function's generic context. (TF-358)- Resolved (0.3). The
@differentiating
attribute can register derivatives with a generic context that is more constrained than the original function's generic context.
- Resolved (0.3). The
- Referring to a
@differentiable
function using key paths leads to a compiler crash. (TF-123)
- Python runtime errors do not show useful source location information. The Python call stack should be shown. (TF-150)
- When an argument to a Python function cannot be converted to a Python
object, the compiler wrongly claims that the function is of non-function
type rather than pointing out that the argument doesn't conform to
PythonConvertible
. (TF-220) - Python TensorFlow cannot be imported because of various issues (binary incompatibility, symbol conflicts).