mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-09 14:47:56 -05:00
Comparison table generation is a special kind. There are no inputs besides output filename. So if the regular name pattern is used we'll get only underscores between the SHA and "tables" in the artifact name.
110 lines
4.0 KiB
YAML
110 lines
4.0 KiB
YAML
name: generate_svg_common
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
backend:
|
|
type: string
|
|
hardware_name:
|
|
type: string
|
|
layer:
|
|
type: string
|
|
pbs_kind: # Valid values are 'classical', 'multi_bit' or 'any'
|
|
type: string
|
|
grouping_factor: # Valid values are 2, 3, or 4
|
|
type: string
|
|
default: 4
|
|
bench_type: # Valid values are 'latency', 'throughput'
|
|
type: string
|
|
backend_comparison:
|
|
type: boolean
|
|
default: false
|
|
time_span_days:
|
|
type: string
|
|
default: 60
|
|
output_filename:
|
|
type: string
|
|
required: true
|
|
secrets:
|
|
DATA_EXTRACTOR_DATABASE_USER:
|
|
required: true
|
|
DATA_EXTRACTOR_DATABASE_HOST:
|
|
required: true
|
|
DATA_EXTRACTOR_DATABASE_PASSWORD:
|
|
required: true
|
|
|
|
permissions: {}
|
|
|
|
# zizmor: ignore[concurrency-limits] caller workflow is responsible for the concurrency
|
|
|
|
jobs:
|
|
generate-table:
|
|
name: generate_svg_common/generate-table
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout tfhe-rs
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
|
with:
|
|
persist-credentials: 'false'
|
|
|
|
- name: Produce table from database
|
|
if: inputs.backend_comparison == false
|
|
run: |
|
|
python3 -m pip install -r ci/data_extractor/requirements.txt
|
|
python3 ci/data_extractor/src/data_extractor.py "${OUTPUT_FILENAME}" \
|
|
--generate-svg \
|
|
--branch "${REF_NAME}" \
|
|
--backend "${BACKEND}" \
|
|
--hardware "${HARDWARE_NAME}" \
|
|
--tfhe-rs-layer "${LAYER}" \
|
|
--pbs-kind "${PBS_KIND}" \
|
|
--grouping-factor "${GROUPING_FACTOR}" \
|
|
--bench-type "${BENCH_TYPE}" \
|
|
--time-span-days "${TIME_SPAN}"
|
|
env:
|
|
OUTPUT_FILENAME: ${{ inputs.output_filename }}
|
|
REF_NAME: ${{ github.ref_name }}
|
|
BACKEND: ${{ inputs.backend }}
|
|
HARDWARE_NAME: ${{ inputs.hardware_name }}
|
|
LAYER: ${{ inputs.layer }}
|
|
PBS_KIND: ${{ inputs.pbs_kind }}
|
|
GROUPING_FACTOR: ${{ inputs.grouping_factor }}
|
|
BENCH_TYPE: ${{ inputs.bench_type }}
|
|
TIME_SPAN: ${{ inputs.time_span_days }}
|
|
DATA_EXTRACTOR_DATABASE_USER: ${{ secrets.DATA_EXTRACTOR_DATABASE_USER }}
|
|
DATA_EXTRACTOR_DATABASE_HOST: ${{ secrets.DATA_EXTRACTOR_DATABASE_HOST }}
|
|
DATA_EXTRACTOR_DATABASE_PASSWORD: ${{ secrets.DATA_EXTRACTOR_DATABASE_PASSWORD }}
|
|
|
|
- name: Upload tables
|
|
if: inputs.backend_comparison == false
|
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
|
|
with:
|
|
name: ${{ github.sha }}_${{ inputs.backend }}_${{ inputs.layer }}_${{ inputs.pbs_kind }}_${{ inputs.bench_type }}_tables
|
|
# This will upload all the file generated
|
|
path: ${{ inputs.output_filename }}*.svg
|
|
retention-days: 60
|
|
|
|
- name: Produce backends comparison table from database
|
|
if: inputs.backend_comparison == true
|
|
run: |
|
|
python3 -m pip install -r ci/data_extractor/requirements.txt
|
|
python3 ci/data_extractor/src/data_extractor.py "${OUTPUT_FILENAME}" \
|
|
--generate-svg \
|
|
--backends-comparison \
|
|
--time-span-days "${TIME_SPAN}"
|
|
env:
|
|
OUTPUT_FILENAME: ${{ inputs.output_filename }}
|
|
TIME_SPAN: ${{ inputs.time_span_days }}
|
|
DATA_EXTRACTOR_DATABASE_USER: ${{ secrets.DATA_EXTRACTOR_DATABASE_USER }}
|
|
DATA_EXTRACTOR_DATABASE_HOST: ${{ secrets.DATA_EXTRACTOR_DATABASE_HOST }}
|
|
DATA_EXTRACTOR_DATABASE_PASSWORD: ${{ secrets.DATA_EXTRACTOR_DATABASE_PASSWORD }}
|
|
|
|
- name: Upload comparison tables
|
|
if: inputs.backend_comparison == true
|
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
|
|
with:
|
|
name: ${{ github.sha }}_backends_comparison_tables
|
|
# This will upload all the file generated
|
|
path: ${{ inputs.output_filename }}*.svg
|
|
retention-days: 60
|