-
Notifications
You must be signed in to change notification settings - Fork 4
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
serving调用时字段类型问题 #129
Comments
在Server启动的时候加载的模型包里 |
1、先训练,会生成一个模型文件 0 {"job_id":"model2024120808521160582","initiator":"com2023011620060497797","max_parallelism":1,"tasks":[{"task_id":"model2024120808521160582-model-export","app_image":"secretflow-image","alias":"model2024120808521160582-model-export","task_input_config":"{"sf_cluster_desc":{"devices":[{"config":"{\"runtime_config\":{\"protocol\":\"SEMI2K\",\"field\":\"FM128\"},\"party_address\":{\"com2023011620072311738\":\"172.16.16.116\",\"com2023011620060497797\":\"172.16.16.111\"},\"link_desc\":{\"connect_retry_times\":60,\"connect_retry_interval_ms\":1000,\"brpc_channel_protocol\":\"http\",\"brpc_channel_connection_type\":\"pooled\",\"recv_timeout_ms\":1200000,\"http_timeout_ms\":1200000}}","name":"spu","parties":["com2023011620060497797","com2023011620072311738"],"type":"spu"},{"config":"{\"mode\":\"PHEU\",\"schema\":\"paillier\",\"key_size\":2048}","name":"heu","parties":["com2023011620060497797","com2023011620072311738"],"type":"heu"}],"parties":["com2023011620060497797","com2023011620072311738"],"ray_fed_config":{"cross_silo_comm_backend":"brpc_link"}},"sf_datasource_config":{"com2023011620060497797":{"id":"default-data-source"},"com2023011620072311738":{"id":"default-data-source"}},"sf_input_ids":[],"sf_node_eval_param":{"attr_paths":["model_name","model_desc","input_datasets","output_datasets","component_eval_params"],"attrs":[{"s":"modelExport-model2024120808521160582"},{"s":""},{"ss":["reefr2024120515141372809-qagbmwrn-node-36-output-0","reefr2024120515141372809-qagbmwrn-node-37-output-0"]},{"ss":["reefr2024120515141372809-qagbmwrn-node-37-output-0","reefr2024120515141372809-qagbmwrn-node-37-output-1","reefr2024120515141372809-qagbmwrn-node-39-output-0","reefr2024120515141372809-qagbmwrn-node-39-output-1"]},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VfdW5rbm93biJdfSx7ImlzX25hIjpmYWxzZSwic3MiOlsieSJdfSx7Imk2NCI6MywiaXNfbmEiOmZhbHNlfSx7ImYiOjAuMDEsImlzX25hIjpmYWxzZX0seyJpNjQiOjE2LCJpc19uYSI6ZmFsc2V9LHsiaXNfbmEiOmZhbHNlLCJzIjoidDEifSx7ImlzX25hIjpmYWxzZSwicyI6ImxvZ2lzdGljIn0seyJpc19uYSI6ZmFsc2UsInMiOiJOb25lIn0seyJmIjowLjUsImlzX25hIjpmYWxzZX0seyJmIjowLjAwMSwiaXNfbmEiOmZhbHNlfSx7ImlzX25hIjp0cnVlfV0sImNoZWNrcG9pbnRfdXJpIjoiY2tiZW9iLXFhZ2Jtd3JuLW5vZGUtMzktb3V0cHV0LTAiLCJkb21haW4iOiJtbC50cmFpbiIsIm5hbWUiOiJzc19zZ2RfdHJhaW4iLCJ2ZXJzaW9uIjoiMC4wLjEifQ=="]}],"domain":"model","name":"model_export","version":"0.0.1"},"sf_output_ids":["model2024120808521160582-model-export-output","model2024120808521160582-model-export-output-report"],"sf_output_uris":["model2024120808521160582-model-export-output","model2024120808521160582-model-export-output-report"]}","priority":100,"parties":[{"domain_id":"com2023011620060497797","role":"partner"},{"domain_id":"com2023011620072311738","role":"partner"}],"dependencies":[]}]} 而我在这个请求里没有指定字段类型呀,为何模型包里定义的字段类型是double |
或者我在上述的合并模型请求里 该怎么指定正确的字段类型呢 |
字段的类型会与你在特征计算的时候输入的表格的字段类型保持一致,如果你没有特征计算的话,会与你训练的输入表的类型保持一致。在导出模型的时候系统会回溯整个流程一直得到原始表的类型信息,换句话说,模型包里包含了从原始表开始每个步骤的输入输出表的类型信息。 |
我没有导出模型 |
model-export 这个接口 我有复用训练时的特征计算,但是训练时的特征计算指定的字段类型是 float呀,但是从serving日志看是double |
是不是可以通过对model-export接口传参指定众字段类型 |
是不是在ss里,那一大长串的base64字符串里 |
在serving里我查出的数据是float类型,但是feature_schema_里指定的数据类型是double,所以我试图做类型转换,将float转换成double,但是失败,类型转换看起来行不通。 |
所以我只能寻找feature_schema_的赋值源头,修改它类型指定,改完 float,使其一致。 |
这是模型导出日志 |
解释一下相关的几个问题:
在你的adpater中,你可以任意转换类型,只需要保证response(https://github.com/secretflow/serving/blob/main/secretflow_serving/feature_adapter/feature_adapter.h#L40) |
看模型导出日志,你的模型导出包含 |
{
"fs_params": {
"com2023011620072311738": {
"query_datas": [
"5"
],
"query_context": "text"
},
"com2023011620060497797": {
"query_datas": [
"7"
],
"query_context": "text"
}
}
}
上述是推理预测请求报文。
申请serving job的报文里也没有指定字段类型。
为什么从日志看,它限定了字段类型是double,
就是代码里feature_schema_里限定字段类型是从哪里定的,或者没看出来是从入参里传的,是默认的吗
可以从哪里主动觉得feature_schema_里的字段类型呢
The text was updated successfully, but these errors were encountered: