Skip to content

Conversation

@alexreinking
Copy link
Member

Fixes #8777

@alexreinking alexreinking requested a review from rtzam August 25, 2025 18:41
rtzam
rtzam previously approved these changes Aug 25, 2025
Copy link
Contributor

@rtzam rtzam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rtzam rtzam self-requested a review August 25, 2025 18:51
@rtzam rtzam dismissed their stale review August 25, 2025 18:51

Compiler Segfaulting when using the added overload

@rtzam
Copy link
Contributor

rtzam commented Aug 25, 2025

Here's a minimal python repro that segfaults at compilation time:

from halide import EvictionKey, Func, Var

x = Var("x")
f = Func("f")
f[x] = 0.0
f[x] = f[x] + 1

print("memoize scheduled")
f.memoize()
# f.memoize(EvictionKey(x))

print("JIT compiling...")
f.compile_jit()

print("realizing...")
result = f.realize([3])

print(result)

@rtzam
Copy link
Contributor

rtzam commented Aug 25, 2025

Documenting slightly smaller test case demonstrating a different symptom:

from halide import Func, Var

x = Var("x")
f = Func("f")
f[x] = 0.0

print("memoize scheduled")
f.memoize()

print("JIT compiling...")
f.compile_jit()

print("realizing...")
result = f.realize([3])

print(result)

Which generates:

    f.compile_jit()
    ~~~~~~~~~~~~~^^
halide.halide_.HalideError: Error: Symbol not found: f.cache_miss

So the pure definition is also a bit broken as well as the update step

@alexreinking alexreinking changed the title Bind memoize and EvictionKey Fix up memoize; bind to Python Aug 26, 2025
@alexreinking alexreinking requested a review from abadams August 26, 2025 18:10
@alexreinking
Copy link
Member Author

Failures, although many, are unrelated.

@alexreinking alexreinking merged commit e3b0ccd into main Aug 27, 2025
11 of 19 checks passed
@alexreinking alexreinking deleted the python/memoize branch August 27, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing Func::memoize overloads and missing EvictionKey class

4 participants