Skip to content

feat: expand bounded TensorFlow CPU unary and BiasAdd surface - #10

Merged
rextio merged 4 commits into
0.1.2from
feat/012-unary-bias-surface
Jul 23, 2026
Merged

rextio merged 4 commits into
0.1.2from
feat/012-unary-bias-surface

Conversation

@rextio

@rextio rextio commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • add rank-1 float32 CPU tf.nn.softmax for omitted final axis or literal positional/keyword axis=0, while preserving the existing rank-2 explicit axis=1 contract
  • add exact rank-1/rank-2 float32 CPU tf.abs, tf.negative, tf.square, tf.exp, tf.math.log, and tf.math.sqrt lowering through owned TFE unary operations
  • add bounded tf.nn.bias_add for rank-2 value plus rank-1 bias with data format omitted or literal NHWC
  • keep tf.maximum and tf.minimum unclaimed until the full broadcast, incompatible-shape, NaN/Inf, and signed-zero matrix is certified across native profiles

Contract and safety

  • retains CPython 3.11, TensorFlow 2.21.0, plugin API 1.3, float32 CPU rank-1/rank-2, and inference-only boundaries
  • preserves exact eager-context reuse, RAII tensor/op ownership, CPU device checks, and result rank/dtype validation
  • resolves the sole new ABI symbol, TFE_OpSetAttrString, through the existing RTLD_NOLOAD handle and dladdr owning-image provenance check before setting data_format=NHWC
  • rejects NCHW, dynamic or forged metadata, keyword tensor operands, unsupported aliases, wrong rank/order/dtype/device, receivers, and extra options
  • does not change Core, LSP, VS Code, CUDA, WASM, training behavior, package pins, platform support, or release state

Verification

  • pytest tests -m "not needs_cargo" -q: 305 passed, 1 skipped
  • ruff check src tests: passed
  • mypy src: passed
  • real-Cargo E2E coverage was expanded for all accepted forms, special values, shape/dtype/rank errors, symbol provenance, and lifetime behavior; the module collects all five tests
  • native Cargo execution was not run locally because this host does not have the required CPython 3.11 + TensorFlow 2.21 environment; the blocking macOS arm64 and Linux x86_64 CI jobs remain authoritative

Commit structure

  1. 0d86e8d — rank-1 Softmax
  2. 4550d24 — bounded math unary operations
  3. 6042222 — bounded NHWC BiasAdd and explicit Maximum/Minimum defer

Release disposition

This PR targets the unreleased 0.1.2 integration branch. It does not authorize merge, tag creation, package publication, or release.

@rextio
rextio merged commit 4f18c71 into 0.1.2 Jul 23, 2026
16 checks passed
@rextio
rextio deleted the feat/012-unary-bias-surface branch July 23, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant