Skip to content

Commit

Permalink
Chore: Update version 0.5.0 (#36)
Browse files Browse the repository at this point in the history
* chore: linting example files

* fix: linting

* chore: updated examples to Nada DSL version 0.6.0

* chore: updated tests to Nada DSL version 0.6.0

* chore: version update to 0.5.0

* cchore: version update

* chore: update poetry.lock
  • Loading branch information
jcabrero authored Aug 30, 2024
1 parent 5e26b9f commit 38e68a5
Show file tree
Hide file tree
Showing 38 changed files with 2,529 additions and 4,524 deletions.
7 changes: 4 additions & 3 deletions examples/complex_model/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@
import numpy as np
import py_nillion_client as nillion
import torch
from common.utils import compute, store_program, store_secrets
from cosmpy.aerial.client import LedgerClient
from cosmpy.aerial.wallet import LocalWallet
from cosmpy.crypto.keypairs import PrivateKey
from dotenv import load_dotenv
from nada_ai.client import TorchClient
from nillion_python_helpers import create_nillion_client, create_payments_config
from nillion_python_helpers import (create_nillion_client,
create_payments_config)
from py_nillion_client import NodeKey, UserKey

from common.utils import compute, store_program, store_secrets
from nada_ai.client import TorchClient

home = os.getenv("HOME")
load_dotenv(f"{home}/.config/nillion/nillion-devnet.env")
Expand Down
1 change: 1 addition & 0 deletions examples/complex_model/src/my_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import nada_numpy as na

from nada_ai import nn


Expand Down
222 changes: 74 additions & 148 deletions examples/complex_model/tests/complex_model.yaml
Original file line number Diff line number Diff line change
@@ -1,151 +1,77 @@
program: complex_model
inputs:
my_input_2_1_0:
SecretInteger: '163840'
my_input_2_2_0:
SecretInteger: '163840'
my_input_0_0_2:
SecretInteger: '163840'
my_model_linear.bias_0:
SecretInteger: '163840'
my_model_conv_module.conv.weight_1_0_0_0:
SecretInteger: '163840'
my_model_linear.weight_1_1:
SecretInteger: '163840'
my_input_0_1_2:
SecretInteger: '163840'
my_model_conv_module.conv.weight_0_1_1_0:
SecretInteger: '163840'
my_model_conv_module.conv.weight_0_2_0_1:
SecretInteger: '163840'
my_model_conv_module.conv.weight_1_0_1_0:
SecretInteger: '163840'
my_input_2_1_1:
SecretInteger: '163840'
my_input_1_1_2:
SecretInteger: '163840'
my_input_2_1_2:
SecretInteger: '163840'
my_input_1_2_2:
SecretInteger: '163840'
my_input_2_3_0:
SecretInteger: '163840'
my_input_0_2_0:
SecretInteger: '163840'
my_model_conv_module.conv.weight_1_2_0_1:
SecretInteger: '163840'
my_input_1_1_1:
SecretInteger: '163840'
my_input_2_2_1:
SecretInteger: '163840'
my_model_conv_module.conv.weight_0_1_0_0:
SecretInteger: '163840'
my_input_0_2_1:
SecretInteger: '163840'
my_input_0_0_1:
SecretInteger: '163840'
my_model_linear.weight_1_2:
SecretInteger: '163840'
my_model_conv_module.conv.weight_1_1_0_1:
SecretInteger: '163840'
my_model_linear.weight_1_3:
SecretInteger: '163840'
my_input_0_0_0:
SecretInteger: '163840'
my_model_conv_module.conv.weight_0_0_1_1:
SecretInteger: '163840'
my_model_conv_module.conv.bias_1:
SecretInteger: '163840'
my_input_1_1_0:
SecretInteger: '163840'
my_model_conv_module.conv.weight_1_2_1_0:
SecretInteger: '163840'
my_input_1_3_0:
SecretInteger: '163840'
my_model_conv_module.conv.bias_0:
SecretInteger: '163840'
my_model_conv_module.conv.weight_1_1_1_1:
SecretInteger: '163840'
my_input_0_3_1:
SecretInteger: '163840'
my_input_2_0_0:
SecretInteger: '163840'
my_input_2_2_2:
SecretInteger: '163840'
my_model_linear.weight_0_0:
SecretInteger: '163840'
my_model_linear.weight_0_3:
SecretInteger: '163840'
my_model_conv_module.conv.weight_0_2_1_1:
SecretInteger: '163840'
my_model_conv_module.conv.weight_1_0_0_1:
SecretInteger: '163840'
my_model_linear.weight_0_1:
SecretInteger: '163840'
my_input_2_3_1:
SecretInteger: '163840'
my_model_conv_module.conv.weight_0_1_1_1:
SecretInteger: '163840'
my_model_conv_module.conv.weight_0_0_1_0:
SecretInteger: '163840'
my_input_2_0_1:
SecretInteger: '163840'
my_input_1_3_2:
SecretInteger: '163840'
my_input_1_0_1:
SecretInteger: '163840'
my_model_conv_module.conv.weight_0_0_0_1:
SecretInteger: '163840'
my_model_conv_module.conv.weight_1_1_0_0:
SecretInteger: '163840'
my_model_linear.weight_1_0:
SecretInteger: '163840'
my_input_2_0_2:
SecretInteger: '163840'
my_model_conv_module.conv.weight_0_2_0_0:
SecretInteger: '163840'
my_input_1_0_2:
SecretInteger: '163840'
my_model_conv_module.conv.weight_0_0_0_0:
SecretInteger: '163840'
my_model_conv_module.conv.weight_1_2_1_1:
SecretInteger: '163840'
my_input_0_2_2:
SecretInteger: '163840'
my_model_conv_module.conv.weight_1_2_0_0:
SecretInteger: '163840'
my_model_linear.bias_1:
SecretInteger: '163840'
my_input_1_0_0:
SecretInteger: '163840'
my_input_0_3_2:
SecretInteger: '163840'
my_model_conv_module.conv.weight_1_0_1_1:
SecretInteger: '163840'
my_model_conv_module.conv.weight_1_1_1_0:
SecretInteger: '163840'
my_input_1_2_0:
SecretInteger: '163840'
my_input_0_1_1:
SecretInteger: '163840'
my_input_0_3_0:
SecretInteger: '163840'
my_model_linear.weight_0_2:
SecretInteger: '163840'
my_model_conv_module.conv.weight_0_2_1_0:
SecretInteger: '163840'
my_model_conv_module.conv.weight_0_1_0_1:
SecretInteger: '163840'
my_input_1_2_1:
SecretInteger: '163840'
my_input_1_3_1:
SecretInteger: '163840'
my_input_0_1_0:
SecretInteger: '163840'
my_input_2_3_2:
SecretInteger: '163840'
my_input_2_1_0: 163840
my_input_2_2_0: 163840
my_input_0_0_2: 163840
my_model_linear.bias_0: 163840
my_model_conv_module.conv.weight_1_0_0_0: 163840
my_model_linear.weight_1_1: 163840
my_input_0_1_2: 163840
my_model_conv_module.conv.weight_0_1_1_0: 163840
my_model_conv_module.conv.weight_0_2_0_1: 163840
my_model_conv_module.conv.weight_1_0_1_0: 163840
my_input_2_1_1: 163840
my_input_1_1_2: 163840
my_input_2_1_2: 163840
my_input_1_2_2: 163840
my_input_2_3_0: 163840
my_input_0_2_0: 163840
my_model_conv_module.conv.weight_1_2_0_1: 163840
my_input_1_1_1: 163840
my_input_2_2_1: 163840
my_model_conv_module.conv.weight_0_1_0_0: 163840
my_input_0_2_1: 163840
my_input_0_0_1: 163840
my_model_linear.weight_1_2: 163840
my_model_conv_module.conv.weight_1_1_0_1: 163840
my_model_linear.weight_1_3: 163840
my_input_0_0_0: 163840
my_model_conv_module.conv.weight_0_0_1_1: 163840
my_model_conv_module.conv.bias_1: 163840
my_input_1_1_0: 163840
my_model_conv_module.conv.weight_1_2_1_0: 163840
my_input_1_3_0: 163840
my_model_conv_module.conv.bias_0: 163840
my_model_conv_module.conv.weight_1_1_1_1: 163840
my_input_0_3_1: 163840
my_input_2_0_0: 163840
my_input_2_2_2: 163840
my_model_linear.weight_0_0: 163840
my_model_linear.weight_0_3: 163840
my_model_conv_module.conv.weight_0_2_1_1: 163840
my_model_conv_module.conv.weight_1_0_0_1: 163840
my_model_linear.weight_0_1: 163840
my_input_2_3_1: 163840
my_model_conv_module.conv.weight_0_1_1_1: 163840
my_model_conv_module.conv.weight_0_0_1_0: 163840
my_input_2_0_1: 163840
my_input_1_3_2: 163840
my_input_1_0_1: 163840
my_model_conv_module.conv.weight_0_0_0_1: 163840
my_model_conv_module.conv.weight_1_1_0_0: 163840
my_model_linear.weight_1_0: 163840
my_input_2_0_2: 163840
my_model_conv_module.conv.weight_0_2_0_0: 163840
my_input_1_0_2: 163840
my_model_conv_module.conv.weight_0_0_0_0: 163840
my_model_conv_module.conv.weight_1_2_1_1: 163840
my_input_0_2_2: 163840
my_model_conv_module.conv.weight_1_2_0_0: 163840
my_model_linear.bias_1: 163840
my_input_1_0_0: 163840
my_input_0_3_2: 163840
my_model_conv_module.conv.weight_1_0_1_1: 163840
my_model_conv_module.conv.weight_1_1_1_0: 163840
my_input_1_2_0: 163840
my_input_0_1_1: 163840
my_input_0_3_0: 163840
my_model_linear.weight_0_2: 163840
my_model_conv_module.conv.weight_0_2_1_0: 163840
my_model_conv_module.conv.weight_0_1_0_1: 163840
my_input_1_2_1: 163840
my_input_1_3_1: 163840
my_input_0_1_0: 163840
my_input_2_3_2: 163840
expected_outputs:
my_output_1:
SecretInteger: '101089280'
my_output_0:
SecretInteger: '101089280'
my_output_1: 101089280
my_output_0: 101089280
11 changes: 6 additions & 5 deletions examples/conv_net/01_provide_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@
import asyncio
import json

import torch
from torch import nn
import nada_numpy as na
import py_nillion_client as nillion
import torch
from common.utils import store_program, store_secrets
from cosmpy.aerial.client import LedgerClient
from cosmpy.aerial.wallet import LocalWallet
from cosmpy.crypto.keypairs import PrivateKey
from dotenv import load_dotenv
from nada_ai.client import TorchClient
from nillion_python_helpers import create_nillion_client, create_payments_config
from nillion_python_helpers import (create_nillion_client,
create_payments_config)
from py_nillion_client import NodeKey, UserKey
from torch import nn

from common.utils import store_program, store_secrets
from nada_ai.client import TorchClient

PARSER = argparse.ArgumentParser()
PARSER.add_argument(
Expand Down
6 changes: 3 additions & 3 deletions examples/conv_net/02_run_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
import nada_numpy.client as na_client
import numpy as np
import py_nillion_client as nillion
from common.utils import compute, store_secret_array
from cosmpy.aerial.client import LedgerClient
from cosmpy.aerial.wallet import LocalWallet
from cosmpy.crypto.keypairs import PrivateKey
from dotenv import load_dotenv
from nillion_python_helpers import create_nillion_client, create_payments_config
from nillion_python_helpers import (create_nillion_client,
create_payments_config)
from py_nillion_client import NodeKey, UserKey

from common.utils import compute, store_secret_array

PARSER = argparse.ArgumentParser()
PARSER.add_argument(
"--features-path",
Expand Down
1 change: 1 addition & 0 deletions examples/conv_net/src/my_nn.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import nada_numpy as na

from nada_ai import nn


Expand Down
Loading

0 comments on commit 38e68a5

Please sign in to comment.