-
Notifications
You must be signed in to change notification settings - Fork 44
Add dcap proof system
#153
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
Open
HudsonGraeme
wants to merge
51
commits into
testnet
Choose a base branch
from
dcap
base: testnet
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 15 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
5cd3b70
Scaffold 🏗️
HudsonGraeme fdd67ea
Clean 🧹
HudsonGraeme 76c0a0d
Add docker to preflight for miners
HudsonGraeme 3af2e9b
Add DCAP models
HudsonGraeme 75570da
Add install for teeonnx
HudsonGraeme d763d81
Refactor, add teeonnx to preflight
HudsonGraeme b00d0e6
Update doc
HudsonGraeme 3435317
+1
HudsonGraeme 6deccd0
Pin version
HudsonGraeme e61e2bf
Add model prefix
HudsonGraeme c16257d
Update prove, verify
HudsonGraeme 83535ae
⚾
HudsonGraeme 42b0e70
json -> bin
HudsonGraeme d6aee1a
Load toml config
HudsonGraeme 16629c2
Update path
HudsonGraeme 4c677e1
Context manager
HudsonGraeme a875d73
rm shell, update chmod
HudsonGraeme bb1b9ca
use 755 for exec
HudsonGraeme 977eb09
witness -> quote
HudsonGraeme 8e4734b
Add error trap
HudsonGraeme 8df09f0
Add error traps
HudsonGraeme 49a208c
Add another error trap
HudsonGraeme d1d4a01
Update post init
HudsonGraeme 0f6f38f
Improve session storage handling
HudsonGraeme 718d625
Improve hash
HudsonGraeme 8652f05
Improve docker check
HudsonGraeme 1854812
--verify -> verify
HudsonGraeme 498ff39
Update comment
HudsonGraeme 52c78b8
Break if miner
HudsonGraeme 56401a1
Merge branch 'testnet' of inference.github.com:inference-labs-inc/omr…
HudsonGraeme d4d0a55
Improve preflight
HudsonGraeme a4c88c1
Adjust tag position
HudsonGraeme 2eb9b3c
Temp disable network weight
HudsonGraeme a5470f4
Use CircuitMetadata
HudsonGraeme e814573
Refactor
HudsonGraeme 852c571
Refactor
HudsonGraeme 118d079
Rename imports
HudsonGraeme 2f7b954
Update perms, mv model to tmp
HudsonGraeme 6394d6e
Tweak param
HudsonGraeme 008f560
Simplify metadata load in preflight
HudsonGraeme 1b64289
Adjust key
HudsonGraeme 3533507
typo
HudsonGraeme 0d51517
Add sudo :/
HudsonGraeme 43fb377
Adjust format
HudsonGraeme ef953c7
Add exec
HudsonGraeme 94ce9f4
Several small improvements
HudsonGraeme b8310f3
Improve conditional and log
HudsonGraeme a8f48a0
750 -> 700
HudsonGraeme 24296db
Improve cmd
HudsonGraeme 06d9421
300s -> 1h
HudsonGraeme 0d422d3
Merge branch 'testnet' of inference.github.com:inference-labs-inc/omr…
HudsonGraeme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -195,3 +195,4 @@ competition_circuit/** | |
|
|
||
| # intellij files | ||
| .idea/ | ||
| **.onnx | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...ent_layer/model_815d49886a610c17e34204b1c544c363bb06328a6cb126181bd0b6e77164cd4b/input.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| from __future__ import annotations | ||
| from pydantic import BaseModel | ||
| from execution_layer.base_input import BaseInput | ||
| from execution_layer.input_registry import InputRegistry | ||
| from _validator.models.request_type import RequestType | ||
| import numpy as np | ||
|
|
||
| BATCH_SIZE = 1 | ||
| SEQUENCE_LENGTH = 64 | ||
|
|
||
|
|
||
| class CircuitInputSchema(BaseModel): | ||
| input_ids: list[list[int]] | ||
| shapes: list[list[int]] | ||
| variables: list[list[object]] | ||
|
|
||
|
|
||
| @InputRegistry.register( | ||
| "815d49886a610c17e34204b1c544c363bb06328a6cb126181bd0b6e77164cd4b" | ||
| ) | ||
| class CircuitInput(BaseInput): | ||
|
|
||
| schema = CircuitInputSchema | ||
|
|
||
| def __init__( | ||
| self, request_type: RequestType, data: dict[str, object] | None = None | ||
| ): | ||
| super().__init__(request_type, data) | ||
|
|
||
| @staticmethod | ||
| def generate() -> dict[str, object]: | ||
| input_ids = np.random.randint( | ||
| 0, 256, size=(BATCH_SIZE, SEQUENCE_LENGTH) | ||
| ).tolist() | ||
| return { | ||
| "input_ids": input_ids, | ||
| "shapes": [[BATCH_SIZE, SEQUENCE_LENGTH]], | ||
| "variables": [["batch_size", BATCH_SIZE], ["sequence", SEQUENCE_LENGTH]], | ||
| } | ||
|
|
||
| @staticmethod | ||
| def validate(data: dict[str, object]) -> None: | ||
| return CircuitInputSchema(**data) | ||
|
|
||
| @staticmethod | ||
| def process(data: dict[str, object]) -> dict[str, object]: | ||
| return data |
11 changes: 11 additions & 0 deletions
11
...ayer/model_815d49886a610c17e34204b1c544c363bb06328a6cb126181bd0b6e77164cd4b/metadata.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| name = "Dishonest Advisor" | ||
| description = "A dishonest advisor which provides generic cryptocurrency advise (NFA)" | ||
HudsonGraeme marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| author = "Inference Labs" | ||
| version = "0.0.1" | ||
| proof_system = "DCAP" | ||
| type = "proof_of_computation" | ||
| benchmark_choice_weight = 0.2 | ||
| network_weight = 0.1 | ||
|
|
||
| [external_files] | ||
| network.onnx = "https://storage.omron.ai/815d49886a610c17e34204b1c544c363bb06328a6cb126181bd0b6e77164cd4b/network.onnx" | ||
47 changes: 47 additions & 0 deletions
47
...ent_layer/model_c2493244e153e8dcb2bfa6e0ebb411b76069074041d95718c47a36f4ec637237/input.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| from __future__ import annotations | ||
| from pydantic import BaseModel | ||
| from execution_layer.base_input import BaseInput | ||
| from execution_layer.input_registry import InputRegistry | ||
| from _validator.models.request_type import RequestType | ||
| import numpy as np | ||
|
|
||
| BATCH_SIZE = 1 | ||
| SEQUENCE_LENGTH = 64 | ||
|
|
||
|
|
||
| class CircuitInputSchema(BaseModel): | ||
| input_ids: list[list[int]] | ||
| shapes: list[list[int]] | ||
| variables: list[list[object]] | ||
|
|
||
|
|
||
| @InputRegistry.register( | ||
| "c2493244e153e8dcb2bfa6e0ebb411b76069074041d95718c47a36f4ec637237" | ||
| ) | ||
| class CircuitInput(BaseInput): | ||
|
|
||
| schema = CircuitInputSchema | ||
|
|
||
| def __init__( | ||
| self, request_type: RequestType, data: dict[str, object] | None = None | ||
| ): | ||
| super().__init__(request_type, data) | ||
|
|
||
| @staticmethod | ||
| def generate() -> dict[str, object]: | ||
| input_ids = np.random.randint( | ||
| 0, 256, size=(BATCH_SIZE, SEQUENCE_LENGTH) | ||
| ).tolist() | ||
| return { | ||
| "input_ids": input_ids, | ||
| "shapes": [[BATCH_SIZE, SEQUENCE_LENGTH]], | ||
| "variables": [["batch_size", BATCH_SIZE], ["sequence", SEQUENCE_LENGTH]], | ||
| } | ||
|
|
||
| @staticmethod | ||
| def validate(data: dict[str, object]) -> None: | ||
| return CircuitInputSchema(**data) | ||
|
|
||
| @staticmethod | ||
| def process(data: dict[str, object]) -> dict[str, object]: | ||
| return data |
11 changes: 11 additions & 0 deletions
11
...ayer/model_c2493244e153e8dcb2bfa6e0ebb411b76069074041d95718c47a36f4ec637237/metadata.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| name = "Honest Advisor" | ||
| description = "An honest advisor which provides generic cryptocurrency advise (NFA)" | ||
| author = "Inference Labs" | ||
| version = "0.0.1" | ||
| proof_system = "DCAP" | ||
| type = "proof_of_computation" | ||
| benchmark_choice_weight = 0.2 | ||
| network_weight = 0.1 | ||
|
|
||
| [external_files] | ||
| network.onnx = "https://storage.omron.ai/c2493244e153e8dcb2bfa6e0ebb411b76069074041d95718c47a36f4ec637237/network.onnx" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.