Skip to content

Caching NetworkInferences#769

Merged
xmariachi merged 14 commits intodevfrom
diego/engn-3550-cache-network-inferences-at-closeworkernonce
Mar 27, 2025
Merged

Caching NetworkInferences#769
xmariachi merged 14 commits intodevfrom
diego/engn-3550-cache-network-inferences-at-closeworkernonce

Conversation

@xmariachi
Copy link
Contributor

@xmariachi xmariachi commented Mar 13, 2025

Purpose of Changes and their Description

  • Stores Network Inferences and Outlier-Resistant Network Inferences
  • Keeps them the same amount of time, pruning as usual after rewards are done.
  • They get filled up at CloseWorkerNonce. A test suite has been added to worker_test.go(there were none) to test validity of the function in general.
  • Related migration changes related (genesis, query)
  • Removes duplicity of GetLatestNetworkAvailableInferences and GetLatestNetworkInferences. Keeping the latter name.
  • Fix reward_test.go tests force-advancing to the end of the wsw.
  • Removes coefficients, weights and also lossBlockHeight from the GetLatestNetworkInferencesResponse.

  • Adds validations for input layer objects

Are these changes tested and documented?

  • If tested, please describe how. If not, why tests are not needed. -- Current unit test fixed, new unit tests added.
  • If documented, please describe where. If not, describe why docs are not needed. -- This is an internalization and fixing of issues, though these are not documented nor need further documentation.
  • Added to Unreleased section of CHANGELOG.md?

@github-actions
Copy link

github-actions bot commented Mar 13, 2025

The latest Buf updates on your PR. Results from workflow Buf Linter / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed⏩ skippedMar 27, 2025, 6:11 PM

@xmariachi xmariachi force-pushed the diego/engn-3550-cache-network-inferences-at-closeworkernonce branch from f03bf43 to cd5c1ea Compare March 14, 2025 19:30
@xmariachi xmariachi marked this pull request as ready for review March 14, 2025 19:30
Copy link
Contributor

@amimart amimart left a comment

Choose a reason for hiding this comment

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

Nice work, I've let a few remarks

amimart
amimart previously approved these changes Mar 18, 2025
Copy link
Contributor

@guilherme-brandao guilherme-brandao left a comment

Choose a reason for hiding this comment

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

Just did a test adding max inferers and forecasters in the network inference generation and it took approx 300ms for just one topic. We need to discuss this number before moving forward since now we will be processing the network inference in the EndBlock.

@xmariachi xmariachi changed the title Initial working version of caching NetworkInferences Caching NetworkInferences Mar 24, 2025
@xmariachi xmariachi force-pushed the diego/engn-3550-cache-network-inferences-at-closeworkernonce branch 3 times, most recently from e00367a to 3f81bd9 Compare March 26, 2025 11:35
@xmariachi
Copy link
Contributor Author

xmariachi commented Mar 26, 2025

Just did a test adding max inferers and forecasters in the network inference generation and it took approx 300ms for just one topic. We need to discuss this number before moving forward since now we will be processing the network inference in the EndBlock.

Different other efforts are being done separately to improve performance.

amimart
amimart previously approved these changes Mar 26, 2025
Copy link
Contributor

@amimart amimart left a comment

Choose a reason for hiding this comment

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

LGTM, just a minor remark up to you :)

@xmariachi xmariachi force-pushed the diego/engn-3550-cache-network-inferences-at-closeworkernonce branch from 2221826 to 63d0872 Compare March 27, 2025 10:42
@xmariachi
Copy link
Contributor Author

Rebased to @guilherme-brandao 's work on #772.
Also found a problem while testing with offchain nodes: latest inferences are taking the last worker commit which is wrong. Should just get the latest from the store.

Copy link
Contributor

@amimart amimart left a comment

Choose a reason for hiding this comment

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

Looks good! 🚀

@xmariachi xmariachi merged commit 024f361 into dev Mar 27, 2025
10 checks passed
@xmariachi xmariachi deleted the diego/engn-3550-cache-network-inferences-at-closeworkernonce branch March 27, 2025 19:04
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.

3 participants