forked from PaddlePaddle/PaddleRec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
68 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
# 在线离线一致性检查 | ||
在线上服务搭建完成之后,为保证正确性,需要对同一批数据进行在线和离线预测,并对比结果,结果一致,才能启动线上服务。 | ||
需要注意的是,在线/离线两个环境,预测的数据、加载的模型需保持一致。 | ||
在线上服务搭建完成之后,为保证正确性,需要对同一批数据进行在线和离线预测,并对比结果,结果一致,才能启动线上服务。 | ||
需要注意的是,在线/离线两个环境,预测的数据、加载的模型需保持一致。 | ||
|
||
## 在线预测 | ||
参见在线预测模块(tools/inference)。 | ||
需要开启debug模式,数据预测过程中打印每一层的输出tensor。 | ||
如果线上预测是通过kv存储获取embedding向量,则还需要将预测数据中的所有feasign对应的embedding输出到文件中。 | ||
参见在线预测模块(tools/inference)。 | ||
需要开启debug模式,数据预测过程中打印每一层的输出tensor。 | ||
如果线上预测是通过kv存储获取embedding向量,则还需要将预测数据中的所有feasign对应的embedding输出到文件中。 | ||
|
||
## 离线预测 | ||
如果sparse embedding过大,离线预测无法单机进行,则需要从线上拿到预测数据所有feasign对应的embedding,并转换成离线能够加载的模型格式,这部分操作在get_xbox_model.py脚本中进行。 | ||
离线预测使用tools/static_ps_offline_infer.py脚本,开启dump功能,打印每一层的输出tensor。 | ||
如果sparse embedding过大,离线预测无法单机进行,则需要从线上拿到预测数据所有feasign对应的embedding,并转换成离线能够加载的模型格式,这部分操作在get_xbox_model.py脚本中进行。 | ||
离线预测使用tools/static_ps_offline_infer.py脚本,开启dump功能,打印每一层的输出tensor。 | ||
|
||
## 一致性检查 | ||
得到在线/离线的预测结果之后,使用onoff_diff.py进行一致性检查。 | ||
得到在线/离线的预测结果之后,使用onoff_diff.py进行一致性检查。 | ||
|
||
## 具体操作 | ||
本教程以[slot_dnn](../models/rank/slot_dnn/README.md)模型为例,介绍在线离线一致性检查的具体操作 | ||
1、启动前准备: | ||
a) 准备预测数据,放入在线环境相应位置及离线slot_dnn目录的infer_data/online下,同时在离线slot_dnn目录中建立infer_data/offline空文件夹 | ||
b) 将离线训练好的模型cp到在线环境中(包括slot_dnn目录下的all_vars.txt文件及模型保存目录下的model和参数文件) | ||
2、启动在线预测:生成cube.result及std.log文件 | ||
3、将上述两个文件cp至tools/onoff_diff/data文件夹下,std.log重命名为log.online | ||
4、在tools/onoff_diff目录下运行sh run.sh,完成离线预测及在线离线一致性检查工作 | ||
本教程以[slot_dnn](../models/rank/slot_dnn/README.md)模型为例,介绍在线离线一致性检查的具体操作 | ||
1、启动前准备: | ||
a) 准备预测数据,放入在线环境相应位置及离线slot_dnn目录的infer_data/online下,同时在离线slot_dnn目录中建立infer_data/offline空文件夹 | ||
b) 将离线训练好的模型cp到在线环境中(包括slot_dnn目录下的all_vars.txt文件及模型保存目录下的model和参数文件) | ||
2、启动在线预测:生成cube.result及std.log文件 | ||
3、将上述两个文件cp至tools/onoff_diff/data文件夹下,std.log重命名为log.online | ||
4、在tools/onoff_diff目录下运行sh run.sh,完成离线预测及在线离线一致性检查工作 |
This file contains 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,22 @@ | ||
# 推荐全流程 | ||
基于推荐场景的技术需求和项目经验,PaddleRec目前已覆盖推荐系统从模型准备到最终线上推理服务的全过程,本教程将索引在推荐全流程中所需的各项功能。 | ||
|
||
## 数据准备 | ||
PaddleRec支持多种数据源,包括文件、kafka、odps、tf_record等,具体数据源适配和接入方法参见[数据接入](../tools/dataset/README.md) | ||
|
||
## 分布式训练 | ||
由于在推荐系统中,会不断产生用于训练模型的日志数据,因此往往采用流式训练模式,即训练数据不是一次性放入训练系统中,而是随着时间不断加入。流式训练具体内容参见[流式训练](./online_trainer.md) | ||
如果你正在做推荐系统的召回模块,可以参考[dssm模型](../models/match/dssm/readme.md),除了具体的组网实现之外,在进阶教程中还提供了关于召回模块需要的离线灌库和裁剪网络功能。 | ||
如果你正在做推荐系统的精排模块,可以参考[slot_dnn模型](../models/rank/slot_dnn/README.md)。 | ||
|
||
## 特征重要性 | ||
在训练过程中,如果你想要衡量模型中特征的重要性,可以参考[特征重要性](./feature_importance.md) | ||
|
||
## 预测 | ||
分布式训练过程中,会保存inference_model用于线上预测。 | ||
1、如果你想要搭建一个独立的预测服务,请参考[Serving部署](./serving.md) | ||
2、如果你已经拥有一个线上服务,想要在其中增加Paddle的推荐预测内容,请参考[Inference部署](../tools/inference/README.md) | ||
|
||
## 在线离线一致性检查 | ||
在线上服务搭建完成,正式投入使用之前,需要进行在线离线一致性检查,确保在线服务的正确性,具体内容参见[在线离线一致性检查](./onoff_diff.md) | ||
|
This file contains 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