Questions about the maturity and intended use of stablehlo_to_tf_saved_model

15 views
Skip to first unread message

Hamza ELBARAGHI

unread,
4:01 AM (9 hours ago) 4:01 AM
to OpenXLA Discuss

Hi all,

I’ve recently started digging deeper into the StableHLO ecosystem, and I’m trying to better understand the role and maturity of the stablehlo_to_tf_saved_model utility.

I have a few questions regarding its intended use and real-world applicability:

  1. What was the original motivation for this tool?
    Since StableHLO is designed to be framework-independent and serve as a portable compiler IR, converting it back to a framework-specific representation (TensorFlow SavedModel) seems somewhat counterintuitive to me. I would have expected downstream usage to favor other MLIR dialects or compiler backends instead. Could someone clarify the primary use case this tool was designed for?

  2. How mature and widely used is this path?
    Has stablehlo_to_tf_saved_model been tested extensively beyond small or synthetic examples (I only found one test with a very simple model, 2 constants)? Is it used in production or large-scale internal pipelines anywhere in the ecosystem?

  3. Scalability to large models (e.g., LLaMA 2 7B)
    Is it realistic to use this utility with very large models (multi-billion parameter scale)?
    In particular:

    • How are large constants/weights typically handled?

    • How are input_locations and state_dict expected to be configured for such models?

    • Is there tooling to automate this process, or is it currently a mostly manual setup?

If anyone has experience using this tool with large transformer models (or can point to relevant discussions or code), I would greatly appreciate any references or insights.

Thanks in advance!
Hamza

Hamza ELBARAGHI

unread,
4:32 AM (8 hours ago) 4:32 AM
to OpenXLA Discuss, Hamza ELBARAGHI
Also another limitations I think is that we could have constants as dense<...> attributes not parameters. As given in the example in the documentation : 

func.func @main(%arg0: tensor<1xf32>, %bias: tensor<1xf32>) -> tensor<1xf32> {
  %0 = stablehlo.add %arg0, %bias: tensor<1xf32>
  return %0 : tensor<1xf32>
}

How can we handle this in stablehlo_to_tf_saved_model API ? Or probably we must implement a pass to somehow parameterize the constants first ?

Thanks!
Reply all
Reply to author
Forward
0 new messages