8000 Ensure HLGExpr tokenize uniquely by fjetter · Pull Request #11849 · dask/dask · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Ensure HLGExpr tokenize uniquely #11849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 25, 2025

Conversation

fjetter
Copy link
Member
@fjetter fjetter commented Mar 25, 2025

Closes pydata/xarray#10171

I've seen these kind of failures during development. I don't fully understand why dask CI was fine with the current code but it might've been related to serialization. This fixes the xarray issue

@@ -136,7 +136,13 @@ def __hash__(self):
return hash(self._name)

def __dask_tokenize__(self):
return self._name
Copy link
Member Author
@fjetter fjetter Mar 25, 2025

Choose a reason for hiding this comment

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

On main

_name -> deterministic_token -> token(self.operands) -> HLG tokenization is not reliable (see

dask/dask/highlevelgraph.py

Lines 999 to 1003 in e0877d0

@normalize_token.register(HighLevelGraph)
def register_highlevelgraph(hlg):
# Note: Layer keys are not necessarily identifying HLGs uniquely
# see https://github.com/dask/dask/issues/9888
return normalize_token(list(hlg.layers.keys()))
/ #9888)

This PR

_name -> deterministic_token -> __dask_tokenize__ -> id(self)

Copy link
Contributor
github-actions bot commented Mar 25, 2025

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

      9 files  ±0        9 suites  ±0   3h 27m 30s ⏱️ - 1m 47s
 17 819 tests ±0   16 604 ✅ ±0   1 215 💤 ±0  0 ❌ ±0 
159 445 runs  ±0  147 332 ✅ +1  12 113 💤  - 1  0 ❌ ±0 

Results for commit aa0a57a. ± Comparison against base commit e0877d0.

This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
dask.tests.test_base ‑ test_optimizations_ctd
dask.tests.test_hlgexpr ‑ test_tokenize

♻️ This comment has been updated with latest results.

@fjetter fjetter merged commit aa36d37 into dask:main Mar 25, 2025
24 checks passed
@fjetter fjetter deleted the ensure_hgl_expr_tokenize_unique branch March 25, 2025 12:45
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.

⚠️ Nightly upstream-dev CI failed ⚠️
1 participant
0