Skip to content
Snippets Groups Projects

Draft: Dev ptq

Closed Cyril Moineau requested to merge DevPTQ into master

TODO

  • Normalize layers
    • Get weight max value for each layer (Fc/Conv)-> alpha
    • Divide weights by alpha
    • Divide bias by alpha
    • Add PerOutputChannel normalization
      • TODO : add steps to do this ...
  • Normalize activation
    • Normalize stimuli between [0;1]
      • or [-1,1]
    • Forward on validation dataset
    • Get max value of activation for each layer -> beta
      • Develop hook sytsem
      • Develop get max activation hook
    • Add scaling factor beta to the activation
    • Add scaling factor beta to the bias
    • Rescale activation by parent bias scaling
  • Quantization
    • Input: multiply by (2^n-1)-1 (singed) or (2^n-1) (unsigned)
    • Weights: Multiply by (2^n-1)-1 + round + store as a signed integer of nbbits size
    • Biases: Multiply by (2^n-1)-1 + Multiply by (2^n-1)-1 (singed) or (2^n-1) (unsigned) + store as a signed integer of nbbits size
    • Activation scaling:
      • Input scaling: (2^n-1)-1 + Multiply by (2^n-1)-1 (singed) or (2^n-1) (unsigned)
      • Output scaling: (2^n-1)-1 (singed) or (2^n-1) (unsigned)
      • Activation sclaing : divide by (input scaling divided bu output_scaling)
  • Activaiton clipping
    • generate histogram of outputs for each layer (using validation dataset)
    • MSE
      • TODO : add steps to do this
    • KL-Divergence
      • TODO : add steps to do this
  • Weights clipping
    • TODO : add steps to do this
  • Better scaling operation
    • Fixed-point scaling
    • Single shift scaling
    • Double shift scaling
  • Bind method in Python
  • LeNet integration test
  • Refactor OutputRange hook to use Tensor Getter/Setter
  • Add docstring to OutputRange hook
  • Refactor hook system to not use registrar ?
Edited by Cyril Moineau

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • assigned to @cmoineau

  • Cyril Moineau changed the description

    changed the description

  • Author Maintainer

    @ikucher I have tried to list all the things to do in order to have a valid PTQ please feel free to notice me if I have forgotten any things :)

  • Cyril Moineau changed the description

    changed the description

  • Cyril Moineau marked the checklist item Get weight max value for each layer (Fc/Conv)-> alpha as completed

    marked the checklist item Get weight max value for each layer (Fc/Conv)-> alpha as completed

  • Cyril Moineau added 1 commit

    added 1 commit

    • f84b462c - [Setup] Update setup to install ib in env.

    Compare with previous version

  • Cyril Moineau added 1 commit

    added 1 commit

    • 64fbc46a - Update hook, add comment and fix minor compilation issues.

    Compare with previous version

  • Cyril Moineau added 1 commit

    added 1 commit

    • 2202cd0f - Reflect hook naming changes.

    Compare with previous version

  • Cyril Moineau marked the checklist item Divide weights by alpha as completed

    marked the checklist item Divide weights by alpha as completed

  • Cyril Moineau marked the checklist item Divide bias by alpha as completed

    marked the checklist item Divide bias by alpha as completed

  • Cyril Moineau marked the checklist item Normalize layers as completed

    marked the checklist item Normalize layers as completed

  • Cyril Moineau marked the checklist item Get max value of activation for each layer -> beta as completed

    marked the checklist item Get max value of activation for each layer -> beta as completed

  • Cyril Moineau marked the checklist item Develop hook sytsem as completed

    marked the checklist item Develop hook sytsem as completed

  • Cyril Moineau marked the checklist item Develop get max activation hook as completed

    marked the checklist item Develop get max activation hook as completed

  • Cyril Moineau marked the checklist item Normalize stimuli between [0;1] or [-1,1] as completed

    marked the checklist item Normalize stimuli between [0;1] or [-1,1] as completed

  • Cyril Moineau marked the checklist item Add scaling factor beta to the bias as completed

    marked the checklist item Add scaling factor beta to the bias as completed

  • Cyril Moineau marked the checklist item Add scaling factor beta to the bias as incomplete

    marked the checklist item Add scaling factor beta to the bias as incomplete

  • Cyril Moineau changed the description

    changed the description

  • Cyril Moineau marked the checklist item Add scaling factor beta to the bias as completed

    marked the checklist item Add scaling factor beta to the bias as completed

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading