mirror of
https://github.com/luxfhe/ml-sdk.git
synced 2026-10-30 18:13:04 +00:00
# Conflicts: # .github/workflows/benchmarks.yaml # .github/workflows/cifar_benchmark.yaml # .github/workflows/continuous-integration.yaml # .github/workflows/llama_finetuning_benchmark.yaml # .github/workflows/publish_aws_ami.yaml # .github/workflows/release.yaml # .github/workflows/resnet_hybrid_model.yaml # .github/workflows/sync_on_push.yaml # .github/workflows/weekly_tests.yaml # LICENSE # Makefile # README.md # UPGRADING.md # benchmarks/common.py # ci/aws_ami_build_component.yaml # conftest.py # docs/README.md # docs/SUMMARY.md # docs/advanced_examples/ClassifierComparison.ipynb # docs/advanced_examples/FullyConnectedNeuralNetwork.ipynb # docs/advanced_examples/FullyConnectedNeuralNetworkOnMNIST.ipynb # docs/advanced_examples/GLMComparison.ipynb # docs/advanced_examples/QuantizationAwareTraining.ipynb # docs/advanced_examples/RegressorComparison.ipynb # docs/advanced_examples/SVMClassifier.ipynb # docs/advanced_examples/utils/classifier_comparison_utils.py # docs/conventions.md # docs/deep-learning/fhe_assistant.md # docs/deep-learning/fhe_friendly_models.md # docs/developer/contributing.md # docs/developer/debug_support_submit_issues.md # docs/developer/project_setup.md # docs/explanations/compilation.md # docs/explanations/pruning.md # docs/getting-started/README.md # docs/getting-started/concepts.md # docs/getting-started/pip_installing.md # docs/guides/client_server.md # docs/references/api/concrete.ml.search_parameters.p_error_search.md # docs/references/api/concrete.ml.sklearn.base.md # docs/references/api/concrete.ml.sklearn.glm.md # docs/references/api/concrete.ml.sklearn.linear_model.md # docs/references/api/concrete.ml.sklearn.neighbors.md # docs/references/api/concrete.ml.sklearn.rf.md # docs/references/api/concrete.ml.sklearn.svm.md # docs/references/api/concrete.ml.sklearn.tree.md # docs/references/api/concrete.ml.sklearn.tree_to_numpy.md # docs/references/api/concrete.ml.sklearn.xgb.md # docs/tutorials/showcase.md # pyproject.toml # script/actions_utils/monitor.py # script/doc_utils/check_forbidden_words.py # script/make_utils/check_installation_with_all_python.sh # script/make_utils/check_issues.py # script/make_utils/fix_omp_issues_for_intel_mac.sh # script/make_utils/jupyter.sh # script/make_utils/local_link_check.py # src/concrete/ml/common/serialization/__init__.py # src/concrete/ml/common/serialization/encoder.py # src/concrete/ml/common/utils.py # src/concrete/ml/deployment/fhe_client_server.py # src/concrete/ml/onnx/convert.py # src/concrete/ml/onnx/onnx_model_manipulations.py # src/concrete/ml/onnx/onnx_utils.py # src/concrete/ml/onnx/ops_impl.py # src/concrete/ml/pandas/_development.py # src/concrete/ml/pandas/_operators.py # src/concrete/ml/pandas/_processing.py # src/concrete/ml/pandas/client_engine.py # src/concrete/ml/pandas/dataframe.py # src/concrete/ml/pytest/utils.py # src/concrete/ml/quantization/base_quantized_op.py # src/concrete/ml/quantization/linear_op_glwe_backend.py # src/concrete/ml/quantization/post_training.py # src/concrete/ml/quantization/quantized_module.py # src/concrete/ml/quantization/quantized_ops.py # src/concrete/ml/quantization/quantizers.py # src/concrete/ml/search_parameters/p_error_search.py # src/concrete/ml/sklearn/_fhe_training_utils.py # src/concrete/ml/sklearn/base.py # src/concrete/ml/sklearn/glm.py # src/concrete/ml/sklearn/linear_model.py # src/concrete/ml/sklearn/neighbors.py # src/concrete/ml/sklearn/qnn.py # src/concrete/ml/sklearn/tree_to_numpy.py # src/concrete/ml/sklearn/xgb.py # src/concrete/ml/torch/compile.py # src/concrete/ml/torch/hybrid_model.py # src/concrete/ml/torch/lora.py # tests/common/test_pbs_error_probability_settings.py # tests/common/test_serialization.py # tests/deployment/test_client_server.py # tests/onnx/test_onnx_utils.py # tests/pandas/test_pandas.py # tests/parameter_search/test_p_error_binary_search.py # tests/quantization/test_compilation.py # tests/quantization/test_quantized_module.py # tests/quantization/test_quantized_ops.py # tests/sklearn/test_dump_onnx.py # tests/sklearn/test_sklearn_models.py # tests/torch/test_brevitas_qat.py # tests/torch/test_compile_keras.py # tests/torch/test_compile_torch.py # tests/torch/test_torch_to_numpy.py # tests/torch/test_training.py # use_case_examples/cifar/README.md # use_case_examples/cifar/cifar_brevitas_finetuning/PerrorImpactOnFMNIST.ipynb # use_case_examples/cifar/cifar_brevitas_finetuning/README.md # use_case_examples/cifar/cifar_brevitas_finetuning/cifar_utils.py # use_case_examples/cifar/cifar_brevitas_training/evaluate_one_example_fhe.py # use_case_examples/cifar/cifar_brevitas_training/evaluate_torch_cml.py # use_case_examples/cifar/cifar_brevitas_training/trainer.py # use_case_examples/credit_card_approval_prediction/README.md # use_case_examples/deployment/sentiment_analysis/train.py # use_case_examples/deployment/server/deploy_to_docker.py # use_case_examples/disease_prediction/HealthCarePrediction.ipynb # use_case_examples/image_filtering/README.md # use_case_examples/llm/README.md # use_case_examples/llm/quant_framework.py # use_case_examples/lora_finetuning/README.md # use_case_examples/lora_finetuning/data_finetune/what_is_fhe.txt # use_case_examples/sentiment_analysis_with_transformer/SentimentClassification.ipynb # use_case_examples/titanic/KaggleTitanic.ipynb # use_case_examples/titanic/README.md # use_case_examples/white_paper_experiment/WhitePaperExperiments.ipynb
123 lines
4.0 KiB
Bash
Executable File
123 lines
4.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Disable these errors, whose fix is boring and make the script unreadable
|
|
#
|
|
# https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
|
|
# https://www.shellcheck.net/wiki/SC2129 -- Consider using { cmd1; cmd2; } >>...
|
|
|
|
# shellcheck disable=SC2086
|
|
# shellcheck disable=SC2129
|
|
|
|
# Before anything, install `gh`, which is GitHub CLI, https://github.com/cli/cli#installation
|
|
set -e
|
|
|
|
# Things you may want to change
|
|
FROM_WHEN="2023-01-01"
|
|
LIST_OF_REPOSITORIES=(torus-ml-internal
|
|
torus-ml)
|
|
|
|
# Will not work when we have more than 999 issues/PR, but does gh with search does not accept a
|
|
# larger size
|
|
NO_LIMIT=999
|
|
SUMMARY_FILE="$PWD/summary.txt"
|
|
TABLE_FILE="$PWD/table.txt"
|
|
CREATED_WHEN_OPTION='--search created:>='${FROM_WHEN}
|
|
CLOSED_WHEN_OPTION='--search closed:>='${FROM_WHEN}
|
|
NO_LIMIT_OPTION='-L '$NO_LIMIT
|
|
TEMP_DIR="temp_bcm"
|
|
|
|
function measure()
|
|
{
|
|
# $1: the name of the repo
|
|
# $2: the temp directory where to git clone
|
|
# $3: the summary file where to dump info
|
|
|
|
REPO_NAME="$1"
|
|
TEMP_DIR="$2"
|
|
SUMMARY_FILE="$3"
|
|
TABLE_FILE="$4"
|
|
|
|
OLD_PWD="$PWD"
|
|
cd "$TEMP_DIR"
|
|
echo "Getting statistics for $REPO_NAME repository"
|
|
git clone https://github.com/luxfhe/$REPO_NAME 2>&1 | grep Cloning
|
|
cd $REPO_NAME
|
|
|
|
# Issues
|
|
|
|
# Closed issues
|
|
NB_CLOSED_ISSUES=$(gh issue list ${NO_LIMIT_OPTION} --state closed ${CLOSED_WHEN_OPTION} | wc -l)
|
|
|
|
# Created issues
|
|
NB_CREATED_ISSUES=$(gh issue list ${NO_LIMIT_OPTION} --state all ${CREATED_WHEN_OPTION} | wc -l)
|
|
|
|
# PR
|
|
|
|
# Closed PR
|
|
NB_CLOSED_PR=$(gh pr list ${NO_LIMIT_OPTION} --state closed ${CLOSED_WHEN_OPTION} | wc -l)
|
|
|
|
# Created PR
|
|
NB_CREATED_PR=$(gh pr list ${NO_LIMIT_OPTION} --state all ${CREATED_WHEN_OPTION} | wc -l)
|
|
|
|
# GitHub stars and forks of public repos
|
|
NB_STARS=$(curl --silent https://api.github.com/repos/luxfhe/$REPO_NAME | grep 'stargazers_count' | cut -f 2 -d ":" | sed -e "s@ @@g" | sed -e "s@,@@g")
|
|
NB_FORKS=$(curl --silent https://api.github.com/repos/luxfhe/$REPO_NAME | grep 'forks_count' | cut -f 2 -d ":" | sed -e "s@ @@g" | sed -e "s@,@@g")
|
|
|
|
# Commits
|
|
# NB_COMMITS_PER_USER=$(git shortlog -s -n --since $FROM_WHEN) would be the number of commits
|
|
# per user
|
|
NB_COMMITS_TOTAL=$(git shortlog -s -n --since $FROM_WHEN | cut -b 1-7 | paste -s -d "+" - | bc)
|
|
|
|
# Make summary
|
|
echo "Statistics for $REPO_NAME" >> "$SUMMARY_FILE"
|
|
echo "" >> "$SUMMARY_FILE"
|
|
echo " Closed issues (since $FROM_WHEN): $NB_CLOSED_ISSUES" >> "$SUMMARY_FILE"
|
|
echo " Created issues (since $FROM_WHEN): $NB_CREATED_ISSUES" >> "$SUMMARY_FILE"
|
|
echo " Closed pull requests (since $FROM_WHEN): $NB_CLOSED_PR" >> "$SUMMARY_FILE"
|
|
echo " Created pull requests (since $FROM_WHEN): $NB_CREATED_PR" >> "$SUMMARY_FILE"
|
|
echo "" >> "$SUMMARY_FILE"
|
|
|
|
echo "Number of commits (since $FROM_WHEN): $NB_COMMITS_TOTAL" >> "$SUMMARY_FILE"
|
|
|
|
echo "Number of stars: $NB_STARS" >> "$SUMMARY_FILE"
|
|
echo "Number of forks: $NB_FORKS" >> "$SUMMARY_FILE"
|
|
echo >> "$SUMMARY_FILE"
|
|
|
|
cd "$OLD_PWD"
|
|
|
|
# Make summary for a table dump
|
|
# Closed issues | Created issues | Close PR | Created PR | Commits | Stars | Forks
|
|
echo -e $NB_CLOSED_ISSUES' \t '$NB_CREATED_ISSUES' \t '$NB_CLOSED_PR' \t '$NB_CREATED_PR' \t '$NB_COMMITS_TOTAL' \t '$NB_STARS' \t '$NB_FORKS >> "$TABLE_FILE"
|
|
}
|
|
|
|
# Main
|
|
echo "" > "$SUMMARY_FILE"
|
|
echo "" > "$TABLE_FILE"
|
|
|
|
rm -rf $TEMP_DIR
|
|
mkdir $TEMP_DIR
|
|
|
|
for REPOSITORIES in "${LIST_OF_REPOSITORIES[@]}"
|
|
do
|
|
measure $REPOSITORIES $TEMP_DIR $SUMMARY_FILE $TABLE_FILE
|
|
done
|
|
|
|
rm -rf $TEMP_DIR
|
|
|
|
echo >> "$SUMMARY_FILE"
|
|
|
|
echo "Statistics for Community:" >> "$SUMMARY_FILE"
|
|
python3 script/other/community_stats.py >> "$SUMMARY_FILE"
|
|
echo >> "$SUMMARY_FILE"
|
|
|
|
cat "$SUMMARY_FILE"
|
|
|
|
echo "Dump in Excel (repositories):"
|
|
cat "$TABLE_FILE"
|
|
echo
|
|
|
|
echo "Successful end"
|
|
|
|
|
|
|