Skip to content

Conversation

@ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Nov 19, 2025

@ricardoV94 ricardoV94 added bug Something isn't working numba labels Nov 19, 2025
@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

❌ Patch coverage is 96.87500% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.71%. Comparing base (cfa76f5) to head (90c8027).

Files with missing lines Patch % Lines
pytensor/link/numba/cache.py 50.00% 0 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (96.87%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@ Coverage Diff @@ ## main #1731 +/- ## ======================================= Coverage 81.71% 81.71% ======================================= Files 251 251 Lines 54112 54112 Branches 9470 9471 +1 ======================================= Hits 44215 44215 Misses 7409 7409 Partials 2488 2488 
Files with missing lines Coverage Δ
pytensor/link/numba/dispatch/basic.py 82.62% <100.00%> (+0.76%) ⬆️
pytensor/link/numba/dispatch/scalar.py 87.93% <100.00%> (-0.07%) ⬇️
pytensor/link/numba/dispatch/subtensor.py 93.77% <100.00%> (-0.03%) ⬇️
pytensor/link/numba/dispatch/tensor_basic.py 98.27% <100.00%> (-0.10%) ⬇️
pytensor/link/numba/cache.py 84.90% <50.00%> (-0.28%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@ricardoV94 ricardoV94 force-pushed the fix_numba_fgraph_key branch 2 times, most recently from 6653e3e to a693592 Compare November 19, 2025 23:19
@ricardoV94 ricardoV94 changed the title Fix numba FunctionGraph cache key Fix numba cache issues and suppress noisy warnings Nov 19, 2025
@ricardoV94 ricardoV94 changed the title Fix numba cache issues and suppress noisy warnings Fix numba cache bugs and suppress noisy warnings Nov 19, 2025
if config.numba__cache and py_func in CACHED_SRC_FUNCTIONS:
return cls(py_func, Path(py_file).parent, CACHED_SRC_FUNCTIONS[py_func])
if py_func in CACHED_SRC_FUNCTIONS and config.numba__cache:
return cls(py_func, py_file, CACHED_SRC_FUNCTIONS[py_func])
Copy link
Member Author

Choose a reason for hiding this comment

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

Numba wants a string for py_file (to emit warnings)

@ricardoV94 ricardoV94 force-pushed the fix_numba_fgraph_key branch 2 times, most recently from 7410ed7 to 90c8027 Compare November 19, 2025 23:44
@ricardoV94 ricardoV94 force-pushed the fix_numba_fgraph_key branch 2 times, most recently from c23a3b7 to 53680c5 Compare November 24, 2025 11:23
It's necessary to encode the edge information, not only the nodes and their ordering
Implementation was specializing on node repeated inputs an `unique_names` would return the same name for repeated inputs. The cache key didn't account for this. We also don't want to compile different functions for different patterns of repeated inputs as it doesn't translate to an obvious handle for the compiler to specialize upon. We we wanted to inline constants that may make more sense.
It's more readable and avoids potential bugs when force_unique is not set to True
@ricardoV94 ricardoV94 merged commit 1453ba0 into pymc-devs:main Nov 25, 2025
98 of 100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working numba

2 participants