How should I be loading the `get_scalar_from_managed_tensor_slice` kernel?

I am apparently missing it, despite using this as my session load:
var model = session.load(
graph,
custom_ops_paths=List(
Path("kernels.mojopkg"),
Path(".magic/envs/default/lib/mojo/_mlir.mojopkg"),
Path(".magic/envs/default/lib/mojo/algorithm.mojopkg"),
Path(".magic/envs/default/lib/mojo/stdlib.mojopkg"),
Path(".magic/envs/default/lib/mojo/buffer.mojopkg"),
Path(".magic/envs/default/lib/mojo/autotune.mojopkg"),
Path(".magic/envs/default/lib/mojo/benchmark.mojopkg"),
Path(".magic/envs/default/lib/mojo/compile.mojopkg"),
Path(".magic/envs/default/lib/mojo/compiler.mojopkg"),
Path(".magic/envs/default/lib/mojo/complex.mojopkg"),
Path(".magic/envs/default/lib/mojo/compiler_internal.mojopkg"),
Path(".magic/envs/default/lib/mojo/kv_cache.mojopkg"),
Path(".magic/envs/default/lib/mojo/gpu.mojopkg"),
Path(".magic/envs/default/lib/mojo/layout.mojopkg"),
Path(".magic/envs/default/lib/mojo/max.mojopkg"),
Path(".magic/envs/default/lib/mojo/runtime.mojopkg"),
Path(".magic/envs/default/lib/mojo/subprocess.mojopkg"),
Path(".magic/envs/default/lib/mojo/tensor_utils_internal.mojopkg"),
Path(".magic/envs/default/lib/mojo/tensor.mojopkg"),
Path(".magic/envs/default/lib/mojo/tensor_utils.mojopkg"),
Path(".magic/envs/default/lib/mojo/tensor_internal.mojopkg"),
),
)
var model = session.load(
graph,
custom_ops_paths=List(
Path("kernels.mojopkg"),
Path(".magic/envs/default/lib/mojo/_mlir.mojopkg"),
Path(".magic/envs/default/lib/mojo/algorithm.mojopkg"),
Path(".magic/envs/default/lib/mojo/stdlib.mojopkg"),
Path(".magic/envs/default/lib/mojo/buffer.mojopkg"),
Path(".magic/envs/default/lib/mojo/autotune.mojopkg"),
Path(".magic/envs/default/lib/mojo/benchmark.mojopkg"),
Path(".magic/envs/default/lib/mojo/compile.mojopkg"),
Path(".magic/envs/default/lib/mojo/compiler.mojopkg"),
Path(".magic/envs/default/lib/mojo/complex.mojopkg"),
Path(".magic/envs/default/lib/mojo/compiler_internal.mojopkg"),
Path(".magic/envs/default/lib/mojo/kv_cache.mojopkg"),
Path(".magic/envs/default/lib/mojo/gpu.mojopkg"),
Path(".magic/envs/default/lib/mojo/layout.mojopkg"),
Path(".magic/envs/default/lib/mojo/max.mojopkg"),
Path(".magic/envs/default/lib/mojo/runtime.mojopkg"),
Path(".magic/envs/default/lib/mojo/subprocess.mojopkg"),
Path(".magic/envs/default/lib/mojo/tensor_utils_internal.mojopkg"),
Path(".magic/envs/default/lib/mojo/tensor.mojopkg"),
Path(".magic/envs/default/lib/mojo/tensor_utils.mojopkg"),
Path(".magic/envs/default/lib/mojo/tensor_internal.mojopkg"),
),
)
2 Replies
Brad Larson
Brad Larson4d ago
Are you setting the environment variable MODULAR_ONLY_USE_NEW_EXTENSIBILITY_API to true when running this? The Magic commands do this in the current examples, and if that's missing you might not be going down the right path to support a custom op with our new extensibility API.
Darkmatter
DarkmatterOP4d ago
I was not, I entered the magic shell and was running mojo directly. That at least seems me further, thank you! I’m now getting a segfault I need to root cause.
Want results from more Discord servers?
Add your server