Commit 92f9434
feat(coprocessor): process work along dependence chains (#1718)
* feat(coprocessor): schedule computations along dependence chains in coprocessor (#1550)
* feat(coprocessor): create dependence_chain table
* feat(coprocessor): coordinate dependence-chain processing across multiple workers
It provides a non-blocking, distributed locking mechanism that
coordinates dependence-chain processing across multiple tfhe-workers.
A worker can acquire ownership of the next available dependence-chain entry for processing
ordered by last_updated_at (FIFO queue-like approach).
Ownership expires after a timeout, enabling work-stealing by other workers.
New CLI param --worker_id
* test(coprocessor): ensure both acquire_next_lock and work-stealing features
* fix(coprocessor): fix work-stealing when a lock has expired
- Added LockingReason for logging
- Make expiry configurable
* fix(coprocessor): update the flow of acquire/extend/release chain_id lock
* chore(coprocessor): update sqlx cache
* chore(coprocessor): improve logging for dcid locking
* chore(coprocessor): disable fallback for dependence_chain_id locking
* fix(coprocessor): update in-memory lock info on extend_current_lock
* fix(coprocessor): lock another dcid and continue processing
* chore(coprocessor): update sqlx cache
* chore(coprocessor): add idx_dependence_chain_processing_by_worker
* chore(coprocessor): observe query timings in tfhe-worker
- add --dcid_ttl_sec config
- add otel traces for dcid
* chore(coprocessor): implement both max_lock_ttl_sec and disable_dcid_locking options
* chore(coprocessor): update sqlx cache
* chore(coprocessor): update last_updated_at when releasing a lock
* chore(coprocessor): support --dcid-timeslice-sec CLI param, tfhe-worker
* chore(coprocessor): solve dcid unit-tests issue
* chore(coprocessor): enable lock re-acquisition once the timeslice has been exceeded
* chore(coprocessor): enable default timeslice
* chore(coprocessor): run cleanup procedure to delete old processed dcids
* chore(coprocessor): acquire locks only on DCIDs that are ready for computation
* chore(coprocessor): update charts with new tfhe-worker args
* chore(coprocessor): handle case no-dcid-available
* chore(coprocessor): bump chart version
* chore(coprocessor): notify work available if dependency count reaches zero
* fix(coprocessor): add dependence chain index on last_updated when processed
* fix(coprocessor): update is_completed only where a CT is inserted in DB
* fix(coprocessor): restrict update of computation completion to uncompleted computations
* fix(coprocessor): prevent dependence cycle overestimation on trivial encrypt handles
* fix(coprocessor): update test for completion of processing of dcid
* fix(coprocessor): add missing partial indexes on ciphertexts and ciphertext_digest tables
* feat(coprocessor): add transaction dependence chains in HL (#1651)
* fix(coprocessor): host-listener, dependency chain
* fix(coprocessor): fix to squash, duplicated trivial encrypt
* fix(coprocessor): fix to squash, duplicated trivial encrypt, test
* fix(coprocessor): fix to squash, scalars are not handles
* fix(coprocessor): fix to squash, cargo fmt
* feat(coprocessor): topologic timestamp
* fix(coprocessor): host-listener, reject cycle and describe out of order dependencies
* fix(coprocessor): do not update dependence chain timestamp on row update
* fix(coprocessor): host-listener, bad condition for need to sort tx
* feat(coprocessor): host-listener, dependency_count for dependency_chain
* feat(coprocessor): host-listener, dependents for dependency_chain
* fix(coprocessor): restrict dependence counter to block scope
* fix(coprocessor): do not update dependence chain last_updated_at on release
* fix(coprocessor): emit warning only when dependence chain is missing dependences
* feat(coprocessor): host-listener, dependency_chain as connected component
* fix(coprocessor): host-listener, update last_updated_at de chain when already processed
* fix(coprocessor): deprecate schedule order in TFHE worker
* chore(coprocessor): fix CI
* fix(coprocessor): host-listener, params for dependency chain policy
* fix(coprocessor): hist-listener, dependency_chain, cycle detection
* chore(coprocessor): update charts for new params
* chore(coprocessor): fix TFHE worker CI test test_extend_or_release_lock_2
---------
Co-authored-by: Antoniu Pop <antoniu.pop@zama.ai>
Co-authored-by: Antoniu Pop <90181190+antoniupop@users.noreply.github.com>
Co-authored-by: rudy <rudy.sicard@zama.ai>
* fix(coprocessor): db migration, improve indexing for sns worker fetching work (#1692)
* fix(coprocessor): db migration, improve indexing for sns worker fetching work
* fix(coprocessor): add missing indexes for selecting allowed handles when tx unsent
---------
Co-authored-by: Antoniu Pop <antoniu.pop@zama.ai>
* feat(coprocessor): add mechanism to release dependence chains when no progress (#1696)
* fix(coprocessor): do not update is_completed on unallowed handles
* feat(coprocessor): add mechanism to release dependence chains when no progress
* fix(coprocessor): remove obsolete row lock on computations
* feat(coprocessor): set created_at as topological order within block
* fix(coprocessor): chain release and update
* chore(coprocessor): update charts
* fix(coprocessor): fix top timestamp for tx
* fix(coprocessor): update earliest schedule order
* fix(coprocessor): remove adding epsilon to timestamp when releasing chain
* fix(coprocessor): split dependence chains after forks instead of before
---------
Co-authored-by: rudy <rudy.sicard@zama.ai>
* fix(coprocessor): add missing indexes on verify_proofs and dependence_chain tables (#1715)
* fix(coprocessor): db-migration, first clean on more obvious unused index (#1722)
* fix(coprocessor): align host listener and poller dependence params (#1728)
---------
Co-authored-by: goshawk-3 <76947196+goshawk-3@users.noreply.github.com>
Co-authored-by: rudy <rudy.sicard@zama.ai>1 parent 662df96 commit 92f9434
53 files changed
Lines changed: 3274 additions & 298 deletions
File tree
- .github/workflows
- charts/coprocessor
- coprocessor/fhevm-engine
- .sqlx
- db-migration/migrations
- host-listener
- src
- bin
- cmd
- database
- poller
- tests
- scheduler/src
- dfg
- stress-test-generator/src
- tfhe-worker
- benches
- src
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
157 | 156 | | |
158 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
| |||
266 | 270 | | |
267 | 271 | | |
268 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
269 | 278 | | |
270 | 279 | | |
271 | 280 | | |
| |||
545 | 554 | | |
546 | 555 | | |
547 | 556 | | |
548 | | - | |
| 557 | + | |
549 | 558 | | |
550 | 559 | | |
551 | 560 | | |
| |||
562 | 571 | | |
563 | 572 | | |
564 | 573 | | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
565 | 591 | | |
566 | 592 | | |
567 | 593 | | |
| |||
Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments