You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@singa.apache.org by zh...@apache.org on 2024/03/07 12:25:51 UTC

(singa) 01/01: Merge pull request #1139 from NLGithubWP/dev-postgresql

This is an automated email from the ASF dual-hosted git repository.

zhaojing pushed a commit to branch dev-postgresql
in repository https://gitbox.apache.org/repos/asf/singa.git

commit 403e81ec864cd278648bf3ab9bf18eca148fdc96
Merge: d3bfa7b3 ab4f87dc
Author: Zhaojing Luo <zh...@gmail.com>
AuthorDate: Thu Mar 7 20:25:43 2024 +0800

    Merge pull request #1139 from NLGithubWP/dev-postgresql
    
    Update Trails for model selection

 .gitignore                                         |    1 +
 .../Dockerfile                                     |   79 -
 .../documents/dev_guide.md                         |  251 ---
 .../documents/image-20231020174425377.png          |  Bin 302750 -> 0 bytes
 .../documents/image-20231020174945226.png          |  Bin 26176 -> 0 bytes
 .../TRAILS-Database-Native-Model-Selection/init.sh |   24 -
 .../internal/ml/model_selection/README.md          |  290 ----
 .../documents/imgs/image-20230421214835152.png     |  Bin 334613 -> 0 bytes
 .../documents/imgs/image-20230421220338391.png     |  Bin 198916 -> 0 bytes
 .../documents/imgs/image-20230421220443231.png     |  Bin 163980 -> 0 bytes
 .../documents/imgs/image-20230702035554579.png     |  Bin 284014 -> 0 bytes
 .../documents/imgs/image-20230702035622198.png     |  Bin 108797 -> 0 bytes
 .../documents/imgs/image-20230702035639502.png     |  Bin 79366 -> 0 bytes
 .../documents/imgs/image-20230702035806963.png     |  Bin 151276 -> 0 bytes
 .../documents/imgs/image-20230722202555763.png     |  Bin 149863 -> 0 bytes
 .../documents/imgs/image-20230722205244718.png     |  Bin 230631 -> 0 bytes
 .../documents/imgs/image-20230724111325368.png     |  Bin 202344 -> 0 bytes
 .../documents/imgs/image-20230724111659545.png     |  Bin 164741 -> 0 bytes
 .../ml/model_selection/exps/draw_img_lib.py        |  724 --------
 .../ml/model_selection/exps/draw_tab_lib.py        |  215 ---
 .../nas_bench_tabular/2.seq_train_dist_online.py   |  163 --
 .../exps/nas_bench_tabular/2.seq_train_online.py   |  118 --
 .../exps/nas_bench_tabular/measure_ecdf.py         |  136 --
 .../exps/nas_bench_tabular/measure_param_auc.py    |  144 --
 .../internal/ml/model_selection/init_env           |   12 -
 .../scripts/anytime_img_w_baseline.sh              |   58 -
 .../ml/model_selection/scripts/anytime_tab.sh      |  142 --
 .../model_selection/scripts/baseline_system_img.sh |   61 -
 .../model_selection/scripts/baseline_system_tab.sh |   83 -
 .../scripts/benchmark_weight_sharing.sh            |   41 -
 .../scripts/latency_embedding_cache.sh             |  138 --
 .../scripts/latency_embedding_cache_concurrent.sh  |  155 --
 .../scripts/latency_phase1_cpu_gpu.sh              |  227 ---
 .../scripts/latency_phase1_in_db.sh                |   77 -
 .../ml/model_selection/scripts/latency_phase2.sh   |   77 -
 .../scripts/micro_budget_aware_alg.sh              |   60 -
 .../model_selection/scripts/micro_nku_tradeoff.sh  |  179 --
 .../scripts/micro_score_metrics_relation.sh        |   54 -
 .../scripts/micro_search_strategy.sh               |   70 -
 .../scripts/nas-bench-img/convert_api_2_json.sh    |   29 -
 .../scripts/nas-bench-img/explore_all_models.sh    |   77 -
 .../scripts/nas-bench-img/score_all_models.sh      |   75 -
 .../nas-bench-tabular/score_all_modesl_frappe.sh   |   44 -
 .../nas-bench-tabular/score_all_modesl_uci.sh      |   44 -
 .../nas-bench-tabular/train_all_models_criteo.sh   |   63 -
 .../train_all_models_criteo_distirbuted.sh         |   64 -
 .../nas-bench-tabular/train_all_models_diabetes.sh |   63 -
 .../nas-bench-tabular/train_all_models_frappe.sh   |   61 -
 .../nas-bench-tabular/train_one_model_dev.sh       |   41 -
 .../nas-bench-tabular/train_params_tune_criteo.sh  |  162 --
 .../train_params_tune_diabetes.sh                  |   86 -
 .../src/controller/core/__init__.py                |   17 -
 .../src/eva_engine/phase1/algo/singa_ms/README.md  |   18 -
 .../model_selection/src/eva_engine/phase1/vote.py  |  133 --
 .../src/eva_engine/phase2/__init__.py              |   17 -
 .../src/eva_engine/phase2/algo/__init__.py         |   17 -
 .../ml/model_selection/src/query_api/__init__.py   |   17 -
 .../model_selection/src/search_space/__init__.py   |   17 -
 .../src/search_space/core/__init__.py              |   17 -
 .../src/search_space/mlp_api/__init__.py           |   17 -
 .../src/third_pkg/darts_lib/__init__.py            |   17 -
 .../src/third_pkg/darts_lib/genotypes.py           |   36 -
 .../src/third_pkg/darts_lib/model.py               |  308 ----
 .../src/third_pkg/darts_lib/util_convert.py        |  126 --
 .../src/third_pkg/sp101_lib/__init__.py            |   17 -
 .../src/third_pkg/sp101_lib/graph_util.py          |  168 --
 .../src/third_pkg/sp101_lib/model_spec.py          |  343 ----
 .../src/third_pkg/sp101_lib/nb101_api.py           |  481 ------
 .../src/third_pkg/sp201_lib/nasbench2.py           |  117 --
 .../src/third_pkg/sp201_lib/nasbench2_ops.py       |  160 --
 .../ml/model_selection/src/tools/__init__.py       |   17 -
 .../internal/pg_extension/sql/filter_phase.sql     |   54 -
 .../internal/pg_extension/sql/pg_extension.sql     |  141 --
 .../internal/pg_extension/src/bindings/model.rs    |   39 -
 .../internal/pg_extension/src/bindings/ms.rs       |  228 ---
 .../requirement.txt                                |   32 -
 examples/model_selection/Trails/.gitignore         |   20 +
 examples/model_selection/Trails/.gitmodules        |    3 +
 .../README.md                                      |   58 +-
 .../Trails/dataset/frappe/decoded_train_feat_id.pt |  Bin 0 -> 8761 bytes
 .../dataset/frappe/decoded_train_feat_value.pt     |  Bin 0 -> 4729 bytes
 .../Trails/dataset/frappe/decoded_train_y.pt       |  Bin 0 -> 1145 bytes
 .../Trails/dataset/frappe/decoded_valid_feat_id.pt |  Bin 0 -> 4729 bytes
 .../dataset/frappe/decoded_valid_feat_value.pt     |  Bin 0 -> 2745 bytes
 .../Trails/dataset/frappe/decoded_valid_y.pt       |  Bin 0 -> 953 bytes
 .../dataset/frappe/test.libsvm                     |    0
 .../dataset/frappe/train.libsvm                    |    0
 .../dataset/frappe/valid.libsvm                    |    0
 .../model_selection/Trails/documents/dev_guide.md  |   12 +
 examples/model_selection/Trails/init.sh            |   42 +
 .../init_polardb.sh}                               |   34 +-
 .../internal/cache-service/cache_service.py        |    1 +
 .../internal/cache-service/trigger_cache_svc.py    |    1 +
 .../internal/ml/model_selection/config.ini         |   30 +-
 .../internal/ml/model_selection/eva_service.py     |    3 +-
 .../ml/model_selection/exps}/0.train_one_model.py  |    5 +-
 .../ml/model_selection/exps}/4.seq_score_online.py |   35 +-
 .../internal/ml/model_selection/exps/README.md     |    7 +-
 .../ml/model_selection/exps/shared_args.py         |  223 +++
 .../internal/ml/model_selection/main.py            |    5 +-
 .../internal/ml/model_selection/pg_interface.py    |   93 +-
 .../internal/ml/model_selection/requirement.txt    |   13 +-
 .../scripts/database/load_data_to_db.sh            |   25 +-
 .../scripts/database/load_data_to_db_int.sh}       |   31 +-
 .../scripts/database/load_data_to_db_raw_source.sh |   25 +
 .../internal/ml/model_selection/shared_config.py   |    4 +-
 .../internal/ml/model_selection/src}/__init__.py   |    3 +
 .../ml/model_selection/src/common}/__init__.py     |    0
 .../ml/model_selection/src/common/constant.py      |   10 +
 .../ml/model_selection/src/common/structure.py     |   23 +-
 .../ml/model_selection/src/controller/__init__.py  |    3 -
 .../ml/model_selection/src/controller/controler.py |   13 +-
 .../src/controller/core}/__init__.py               |    0
 .../model_selection/src/controller/core/metrics.py |    1 +
 .../model_selection/src/controller/core/sample.py  |    2 +
 .../src/controller/sampler_all}/__init__.py        |    3 +
 .../src/controller/sampler_all/seq_sampler.py      |    4 +-
 .../src/controller/sampler_bohb/bohb_or.py         |  294 ++++
 .../src/controller/sampler_ea}/__init__.py         |    3 +
 .../src/controller/sampler_ea/regularized_ea.py    |  103 +-
 .../src/controller/sampler_rand}/__init__.py       |    3 +
 .../src/controller/sampler_rand/random_sample.py   |    1 +
 .../src/controller/sampler_rl}/__init__.py         |    3 +
 .../sampler_rl/reinforcement_learning.py           |    2 +-
 .../model_selection/src/dataset_utils}/__init__.py |    1 +
 .../model_selection/src/dataset_utils/dataset.py   |  217 +++
 .../dataset_utils/download_critero_and_avazu.py    |    0
 .../src/dataset_utils/h5py_dataset.py              |   59 +
 .../src/dataset_utils/imagenet16.py                |  137 ++
 .../src/dataset_utils/save_load_torch.py           |  106 ++
 .../src/dataset_utils/sequence_dataloader.py       |    5 +-
 .../src/dataset_utils/stream_dataloader.py         |    5 +-
 .../src/dataset_utils/structure_data_loader.py     |  276 +++
 .../ml/model_selection/src/eva_engine/__init__.py  |    6 +-
 .../model_selection/src/eva_engine/coordinator.py  |    1 +
 .../src/eva_engine/phase1}/__init__.py             |    0
 .../src/eva_engine/phase1/algo}/__init__.py        |    0
 .../src/eva_engine/phase1/algo/alg_base.py         |  150 ++
 .../src/eva_engine/phase1/algo/prune_synflow.py    |   29 +-
 .../src/eva_engine/phase1/algo/singa_ms/README.md  |    2 +
 .../phase1/algo/singa_ms/cnn_ms/README.md          |    0
 .../cnn_ms/autograd/cifar10_multiprocess.py        |    0
 .../algo/singa_ms/cnn_ms/autograd/mnist_cnn.py     |    0
 .../algo/singa_ms/cnn_ms/autograd/mnist_dist.py    |    0
 .../singa_ms/cnn_ms/autograd/mnist_multiprocess.py |    0
 .../singa_ms/cnn_ms/autograd/resnet_cifar10.py     |  584 +++----
 .../algo/singa_ms/cnn_ms/autograd/resnet_dist.py   |    0
 .../cnn_ms/autograd/sparsification_mnist.py        |    0
 .../algo/singa_ms/cnn_ms/autograd/xceptionnet.py   |    0
 .../phase1/algo/singa_ms/cnn_ms/benchmark.py       |    0
 .../phase1/algo/singa_ms/cnn_ms/data/cifar10.py    |  178 +-
 .../phase1/algo/singa_ms/cnn_ms/data/cifar100.py   |  162 +-
 .../algo/singa_ms/cnn_ms/data/download_cifar10.py  |    0
 .../algo/singa_ms/cnn_ms/data/download_cifar100.py |    0
 .../algo/singa_ms/cnn_ms/data/download_mnist.py    |    0
 .../phase1/algo/singa_ms/cnn_ms/data/mnist.py      |    0
 .../phase1/algo/singa_ms/cnn_ms/model/alexnet.py   |    0
 .../phase1/algo/singa_ms/cnn_ms/model/cnn.py       |    0
 .../phase1/algo/singa_ms/cnn_ms/model/resnet.py    |    0
 .../algo/singa_ms/cnn_ms/model/xceptionnet.py      |    0
 .../algo/singa_ms/cnn_ms/pkg_model_code/model.py   |    0
 .../eva_engine/phase1/algo/singa_ms/cnn_ms/run.sh  |    0
 .../phase1/algo/singa_ms/cnn_ms/train_cnn.py       |    0
 .../phase1/algo/singa_ms/cnn_ms/train_mpi.py       |    0
 .../phase1/algo/singa_ms/cnn_ms/train_ms_model.py  |    0
 .../algo/singa_ms/cnn_ms/train_multiprocess.py     |    0
 .../phase1/algo/singa_ms/ms_model_mlp/model.py     |    0
 .../phase1/algo/singa_ms/ms_model_mlp/native.py    |    0
 .../eva_engine/phase1/algo/singa_ms/msmlp/model.py |    0
 .../phase1/algo/singa_ms/msmlp/native.py           |    0
 .../src/eva_engine/phase1/concurrent_evaluator.py  |  213 +++
 .../src/eva_engine/phase1/evaluator.py             |  526 ++++++
 .../src/eva_engine/phase1/run_phase1.py            |  169 ++
 .../src/eva_engine/phase2}/__init__.py             |    2 +
 .../src/eva_engine/phase2/algo}/__init__.py        |    2 +-
 .../src/eva_engine/phase2/algo/trainer.py          |  349 +++-
 .../src/eva_engine/phase2/evaluator.py             |   97 ++
 .../src/eva_engine/phase2/run_sh.py                |  182 ++
 .../src/eva_engine/phase2/run_sr.py                |  104 +-
 .../src/eva_engine/phase2/run_uniform.py           |   41 +-
 .../ml/model_selection/src/eva_engine/run_ms.py    |  353 ++++
 .../ml/model_selection/src/logger/__init__.py      |    0
 .../ml/model_selection/src/query_api/README.md     |    0
 .../ml/model_selection/src/query_api}/__init__.py  |    3 +
 .../src/query_api/img_explore_ea.py                |    4 +-
 .../src/query_api/img_train_baseline.py            |    1 +
 .../ml/model_selection/src/query_api/interface.py  |   12 +-
 .../model_selection/src/query_api/query_api_img.py |    5 +-
 .../model_selection/src/query_api/query_api_mlp.py |   16 +-
 .../ml/model_selection/src/query_api/singleton.py  |    1 +
 .../model_selection/src/search_space}/__init__.py  |    0
 .../src/search_space/core}/__init__.py             |    0
 .../src/search_space/core/model_params.py          |    1 -
 .../src/search_space/core/rl_policy.py}            |    5 +
 .../model_selection/src/search_space/core/space.py |  193 +++
 .../src/search_space/init_search_space.py          |    6 +-
 .../src/search_space/mlp_api}/__init__.py          |    0
 .../src/search_space/mlp_api/model_params.py       |    1 +
 .../src/search_space/mlp_api/rl_policy.py          |    1 +
 .../src/search_space/mlp_api/space.py              |  281 ++-
 .../src/search_space/utils}/__init__.py            |    6 +
 .../src/search_space/utils/weight_initializers.py  |    6 +-
 .../ml/model_selection/src/tools}/__init__.py      |    1 +
 .../ml/model_selection/src/tools/compute.py        |    5 +-
 .../ml/model_selection/src/tools/correlation.py    |    0
 .../ml/model_selection/src/tools/io_tools.py       |    5 +-
 .../ml/model_selection/src/tools/res_measure.py    |   17 +-
 .../internal/ml/model_selection/src/tools/utils.py |   17 +-
 .../Trails/internal/ml/model_slicing/README.md     | 1092 ++++++++++++
 .../internal/ml/model_slicing/baseline_int.py      |  206 +++
 .../ml/model_slicing/data/adult_col_cardinalities  |    1 +
 .../ml/model_slicing/data/bank_col_cardinalities   |    1 +
 .../ml/model_slicing/data/census_col_cardinalities |    1 +
 .../ml/model_slicing/data/credit_col_cardinalities |    1 +
 .../ml/model_slicing/data/cvd_col_cardinalities    |    1 +
 .../model_slicing/data/diabetes_col_cardinalities  |    1 +
 .../ml/model_slicing/data/frappe_col_cardinalities |    1 +
 .../ml/model_slicing/data/hcdr_col_cardinalities   |    1 +
 .../internal/ml/model_slicing/pg_interface.py      |  351 ++++
 .../ml/model_slicing/profile_preprocess.py         |   74 +
 .../internal/ml/model_slicing/save_satistics.py}   |   53 +-
 .../internal/pg_extension/.cargo/config.toml       |    0
 .../Trails/internal/pg_extension/.gitignore        |    6 +
 .../internal/pg_extension/pg_extension.control     |    0
 .../pg_extension/sql/model_selection_cpu.sql       |    7 +-
 .../sql/model_selection_cpu_workloads.sql          |    3 +-
 .../pg_extension/sql/model_selection_dev.sql       |    3 +-
 .../pg_extension/sql/model_selection_trails.sql    |    3 +-
 .../sql/model_selection_trails_workloads.sql       |    3 +-
 .../pg_extension/sql/pg_extension--0.1.0.sql       |  221 +++
 .../pg_extension/src/bindings/inference.rs         |  797 +++++++++
 .../pg_extension/src/bindings/ml_register.rs       |   23 +-
 .../internal/pg_extension/src/bindings/mod.rs      |   10 +-
 .../internal/pg_extension/src/bindings/ms.rs       |  265 +++
 .../internal/pg_extension/src/lib.rs               |  113 +-
 .../pg_extension/template/Cargo.pg11.toml}         |    3 +-
 .../pg_extension/template/Cargo.pg14.toml}         |    1 +
 .../internal/pg_extension/test/lib.rs              |   42 +-
 .../ml/model_selection => Trails}/requirement.txt  |   13 +-
 .../Trails/singa.polarDB.Dockerfile                |   83 +
 .../singa.psql.Dockerfile}                         |   25 +-
 .../singa_pkg_code}/model.py                       |   28 +-
 .../singa-3.1.0-cp38-cp38-manylinux2014_x86_64.whl |  Bin 0 -> 21969491 bytes
 .../Trails/singa_pkg_code/tensor.py                | 1804 ++++++++++++++++++++
 244 files changed, 9998 insertions(+), 7865 deletions(-)