Skip to content
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

[Bug]: dear teachers, how can i know the input after spu, thanks very much!!! #908

Closed
zhangwaer opened this issue Nov 7, 2024 · 5 comments

Comments

@zhangwaer
Copy link

Issue Type

Build/Install

Modules Involved

MPC protocol

Have you reproduced the bug with SPU HEAD?

Yes

Have you searched existing issues?

Yes

SPU Version

0.9.3.dev20241013

OS Platform and Distribution

Ubuntu 18.04.6 LTS

Python Version

3.9.20

Compiler Version

GCC11.2.0

Current Behavior?

For example, how can i know the model_params and input_token_ids, thanks very much!!!

def get_model_params():
pretrained_model = FlaxGPT2LMHeadModel.from_pretrained("gpt2")
return pretrained_model.params

def get_token_ids():
tokenizer = AutoTokenizer.from_pretrained("gpt2")
return tokenizer.encode('I enjoy walking with my cute dog', return_tensors='jax')

model_params = alice(get_model_params)()
input_token_ids = bob(get_token_ids)()

device = spu
model_params_, input_token_ids_ = model_params.to(device), input_token_ids.to(device)

output_token_ids = spu(text_generation)(input_token_ids_, model_params_)

Standalone code to reproduce the issue

print("A bug")

Relevant log output

No response

@tpppppub
Copy link
Collaborator

tpppppub commented Nov 8, 2024

I think secretflow's documentation is clear

@zhangwaer
Copy link
Author

I think secretflow's documentation is clear

thanks very much!!

@zhangwaer zhangwaer reopened this Nov 8, 2024
@zhangwaer
Copy link
Author

I think secretflow's documentation is clear

reveal can get the plain input, but how i can i get the secret shares. could you please give me some advice, thanks very much!!

@tpppppub
Copy link
Collaborator

@zhangwaer
Copy link
Author

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

No branches or pull requests

2 participants