feat: Update CoreML device support and server controls
- Replace 'mps' with 'coreml' as the identifier for Apple CoreML Execution Provider across the codebase. - Remove Apple chip generation checks and ensure CoreML is available on all macOS arm64 devices. - Adjust ONNX Runtime session creation to use default CoreML configurations without forcing 'MLProgram'. - Implement support for MoGe-2 to utilize CoreML with static input shape requirements. - Enhance server panel to display restart and stop controls consistently across running states, including 'BUSY'. - Update UI tests to verify new behavior for server controls and cached model display. - Bump blendjob dependency version to 0.1.16 in packaging tests and configurations.
This commit is contained in:
@@ -61,7 +61,7 @@ class OnnxRuntimeTest(unittest.TestCase):
|
||||
),
|
||||
)
|
||||
|
||||
def test_coreml_and_cpu_session_options_are_preserved(self):
|
||||
def test_coreml_and_cpu_use_plain_session_providers(self):
|
||||
runtime, calls = self.create_runtime(
|
||||
["CoreMLExecutionProvider", "CPUExecutionProvider"]
|
||||
)
|
||||
@@ -69,17 +69,62 @@ class OnnxRuntimeTest(unittest.TestCase):
|
||||
with patch.dict(sys.modules, {"onnxruntime": runtime}):
|
||||
onnx_runtime.create_session("model.onnx", "auto")
|
||||
|
||||
self.assertEqual(
|
||||
calls[0][1],
|
||||
[
|
||||
"CoreMLExecutionProvider",
|
||||
"CPUExecutionProvider",
|
||||
],
|
||||
)
|
||||
|
||||
def test_model_options_only_configure_coreml_provider(self):
|
||||
runtime, calls = self.create_runtime(
|
||||
["CoreMLExecutionProvider", "CPUExecutionProvider"]
|
||||
)
|
||||
|
||||
with patch.dict(sys.modules, {"onnxruntime": runtime}):
|
||||
onnx_runtime.create_session(
|
||||
"model.onnx",
|
||||
"coreml",
|
||||
coreml_options={"RequireStaticInputShapes": "1"},
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
calls[0][1],
|
||||
[
|
||||
(
|
||||
"CoreMLExecutionProvider",
|
||||
dict(onnx_runtime.COREML_PROVIDER_OPTIONS),
|
||||
{"RequireStaticInputShapes": "1"},
|
||||
),
|
||||
"CPUExecutionProvider",
|
||||
],
|
||||
)
|
||||
|
||||
def test_coreml_device_selects_coreml_provider(self):
|
||||
available = [
|
||||
"CoreMLExecutionProvider",
|
||||
"CPUExecutionProvider",
|
||||
]
|
||||
|
||||
self.assertEqual(
|
||||
onnx_runtime.select_providers("coreml", available),
|
||||
["CoreMLExecutionProvider", "CPUExecutionProvider"],
|
||||
)
|
||||
self.assertEqual(
|
||||
onnx_runtime.select_providers(
|
||||
"coreml",
|
||||
["CPUExecutionProvider"],
|
||||
),
|
||||
["CPUExecutionProvider"],
|
||||
)
|
||||
|
||||
def test_old_mps_device_is_rejected(self):
|
||||
with self.assertRaises(KeyError):
|
||||
onnx_runtime.select_providers(
|
||||
"mps",
|
||||
["CoreMLExecutionProvider", "CPUExecutionProvider"],
|
||||
)
|
||||
|
||||
def test_completing_cuda_run_shrinks_memory_arena(self):
|
||||
configs = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user