Skip to content

Ericjenn srpwg wg1#119

Open
ericjenn wants to merge 1086 commits intoonnx:mainfrom
ericjenn:ericjenn-srpwg-wg1
Open

Ericjenn srpwg wg1#119
ericjenn wants to merge 1086 commits intoonnx:mainfrom
ericjenn:ericjenn-srpwg-wg1

Conversation

@ericjenn
Copy link
Copy Markdown
Contributor

Update of the SONNX working group material (located under directory "safety-related-profile")

ericjenn and others added 30 commits January 19, 2026 09:30
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Clarified the definition of L in the Broadcast signature, specifying that L cannot be equal to 2^31-1.

Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Clarify the conditions for tensor broadcasting in the documentation.

Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Clarified the description of tensor data access in broadcasting conditions.

Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Clarify the explanation of data access for output tensor dimensions.

Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Updated error statement to reference Numpy broadcasting rules.

Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Updated Airbus' use case.

Signed-off-by: Jean Souyris <jean.souyris@airbus.com>
JeanLoupFarges and others added 30 commits April 3, 2026 10:30
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Clarified terminology for formalization levels in SONNX.

Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Clarified terminology for operator formalization levels.

Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Added a note to define the concept of mathematical construct.

Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Clarified the definition of tensors and their representation, emphasizing valid coordinate access.

Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Clarify the proposal regarding function signatures and contracts.

Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Review by Edoardo

Signed-off-by: emanino <40175301+emanino@users.noreply.github.com>
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
…broadcast.md

Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
Refactored broadcast functions to use a list of tensors as input and output.

Signed-off-by: JeanLoupFarges <86069696+JeanLoupFarges@users.noreply.github.com>
### What has been implemented

- Abstract specification (OPTanh)
  - Defined an abstract exponential function `exp_r` to model the mathematical behavior of the exponential.
  - Specified `tanh_r` using three equivalent mathematical formulations:
    - (exp(x) - exp(-x)) / (exp(x) + exp(-x))
    - (exp(2x) - 1) / (exp(2x) + 1)
    - (1 - exp(-2x)) / (1 + exp(-2x))
  - Ensured consistency with the informal ONNX specification at the mathematical level.
  - Implemented `dtanh` to apply tanh element-wise over tensor data.
  - Defined `optanh` to construct the resulting tensor while preserving shape and background.

- Concrete implementation (CTensorTanh)
  - Introduced `ctanh` as the floating-point implementation of tanh, formally linked to `tanh_r`.
  - Implemented `ctensor_tanh` as a loop over the flattened tensor memory.
  - Maintained a loop invariant ensuring correctness of partial computation.
  - Proved that the final tensor matches the abstract specification (`optanh`).

- Formal verification
  - All verification conditions are successfully discharged using Why3.
  - The implementation is formally proven to be consistent with the abstract specification.

### Correspondence with the informal specification

- Element-wise application of tanh over the tensor is fully respected.
- Shape preservation constraint is enforced (`result ~= input`).
- Mathematical definition of tanh is captured via multiple equivalent formulations.
- No error conditions are required, consistent with the informal specification.

### Limitations / Remaining work

- ⚠ The exponential function `exp_r` is abstract and not tied to a concrete implementation.
- ⚠ IEEE-754 floating-point semantics (NaN, ±inf handling) are not explicitly modeled.
- ⚠ Numerical accuracy aspects (error propagation and introduction) described in the informal spec are not formally encoded.
- ⚠ No formal link yet between `ctanh` and an actual C math library implementation (e.g., `tanh` from `<math.h>`).

Signed-off-by: HamzaSeyfu <165190579+HamzaSeyfu@users.noreply.github.com>
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.