yobx.torch.interpreter.native_export#
Lowers exported PyTorch programs through the native ONNX graph engines.
- class yobx.torch.interpreter.native_export.NativeTorchInterpreter(builder, graph_module, dispatcher=None, raise_list=None)[source]#
Owns FX bookkeeping while native engines own graph and shape state.
ATen lowering only emits native operators. It does not run the legacy FX interpreter, Python shape rules, Python graph builder or Python optimizer. Unsupported operators fail at their FX node instead of falling back.
- assert_tensor_metadata(node)[source]#
Discharges only assertions proved by exported tensor metadata.
- branch(module, operands, prefix)[source]#
Builds an ONNX If branch with native inference and lexical captures.
- broadcast_tensors(tensors, name)[source]#
Expands tensors to a shared runtime shape without promoting their dtypes.
- convolution(op, args, kwargs, outputs)[source]#
Lowers convolution attributes without computing output shapes.
- custom(node, args, kwargs, name)[source]#
Calls an explicit custom lowering or rejects an unsupported FX target.
- remainder(node, args, outputs)[source]#
Computes floor remainder with exact integer and floating fmod semantics.
- yobx.torch.interpreter.native_export.to_onnx(mod, args=None, kwargs=None, input_names=None, target_opset=None, as_function=False, options=None, verbose=0, return_builder=False, raise_list=None, dynamic_shapes=None, optimize=True, dispatcher=None, large_model=False, external_threshold=1024, export_options=None, return_optimize_report=False, filename=None, inline=True, export_modules_as_functions=False, function_options=None, output_names=None, output_dynamic_shapes=None, validate_onnx=False, return_ep=False)[source]#
Exports a supported Torch program using only native ONNX graph engines.
Tensor arguments, captured parameters, dynamic dimensions, standard ATen operations and
torch.condare supported. Nested argument pytrees, mutations, alternative tracing frontends and module-boundary function preservation are rejected explicitly. Standalone function export promotes weights to function inputs or embeds native Constant nodes.