openxla / stablehlo

Backward compatible ML compute opset inspired by HLO/MHLO
Apache License 2.0
357 stars 100 forks source link

support get_smaller_version in python binding #2396

Closed qingyunqu closed 2 weeks ago

qingyunqu commented 3 weeks ago

Support get_smaller_version(version1, version2) in stablehlo's python binding. Example usage:

version = get_smaller_version(frontend_compiler.get_current_version(), backend_compiler.get_current_version())
serialize_portable_artifact(module, version)
GleasonK commented 2 weeks ago

Mostly lgtm but Could you add a pr description for use cases for such an API?