Skip to content

Commit

Permalink
New files (#852)
Browse files Browse the repository at this point in the history
* Adding new files for gpu setup

* Pointing to right files

* Minor correction when calculating buffer positions

* Updating goldilocks

* Transpose tmp polinomials is now optional

---------

Co-authored-by: Ricard Borrell <75077385+rickb80@users.noreply.github.com>
  • Loading branch information
RogerTaule and rickb80 committed Jul 9, 2024
1 parent 1fc5cf6 commit f39b263
Show file tree
Hide file tree
Showing 33 changed files with 1,285 additions and 1,299 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/prover_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
- name: remove old proofs
run: rm -rf runtime/output/*
- name: list gha config files
run: ls /home/gha/v7.0.0-rc.1-fork.10/config/
run: ls /home/gha/v7.0.0-rc.14-fork.10/config/
- name: link files
run: ln -s /home/gha/v7.0.0-rc.1-fork.10/config/ config
run: ln -s /home/gha/v7.0.0-rc.14-fork.10/config/ config
- name: list local config files
run: ls config
- name: run collection native tests
Expand Down
2 changes: 2 additions & 0 deletions src/config/definitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@

#define NROWS_PACK 4

#define TRANSPOSE_TMP_POLS true

//#define MULTI_ROM_TEST

//#define ENABLE_EXPERIMENTAL_CODE
Expand Down
2 changes: 1 addition & 1 deletion src/goldilocks
6 changes: 3 additions & 3 deletions src/starkpil/chelpers_steps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ class CHelpersSteps {
}
}
}
nColsStagesAcc[10] = nColsStagesAcc[9] + nColsStages[9]; // Polinomials f & q
nColsStagesAcc[10] = nColsStagesAcc[9] + nColsStages[4]; // Polinomials f & q
if(stage == 4) {
offsetsStages[10] = starkInfo.mapOffsets.section[eSection::q_2ns];
nColsStages[10] = starkInfo.qDim;
} else if(stage == 5) {
offsetsStages[10] = starkInfo.mapOffsets.section[eSection::f_2ns];
nColsStages[10] = 3;
}
nColsStagesAcc[11] = nColsStagesAcc[10] + 3; // xDivXSubXi
nCols = nColsStagesAcc[11] + 6;
nColsStagesAcc[11] = nColsStagesAcc[10] + nColsStages[10]; // xDivXSubXi
nCols = nColsStagesAcc[11] + 6; // 3 for xDivXSubXi and 3 for xDivXSubWxi
}

inline virtual void storePolinomials(StarkInfo &starkInfo, StepsParams &params, __m256i *bufferT_, uint8_t* storePol, uint64_t row, uint64_t nrowsPack, uint64_t domainExtended) {
Expand Down
6 changes: 3 additions & 3 deletions src/starkpil/chelpers_steps_avx512.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ class CHelpersStepsAvx512 : public CHelpersSteps {
}
}
}
nColsStagesAcc[10] = nColsStagesAcc[9] + nColsStages[9]; // Polinomials f & q
nColsStagesAcc[10] = nColsStagesAcc[9] + nColsStages[4]; // Polinomials f & q
if(stage == 4) {
offsetsStages[10] = starkInfo.mapOffsets.section[eSection::q_2ns];
nColsStages[10] = starkInfo.qDim;
} else if(stage == 5) {
offsetsStages[10] = starkInfo.mapOffsets.section[eSection::f_2ns];
nColsStages[10] = 3;
}
nColsStagesAcc[11] = nColsStagesAcc[10] + 3; // xDivXSubXi
nCols = nColsStagesAcc[11] + 6;
nColsStagesAcc[11] = nColsStagesAcc[10] + nColsStages[10]; // xDivXSubXi
nCols = nColsStagesAcc[11] + 6; // 3 for xDivXSubXi and 3 for xDivXSubWxi
}

inline virtual void storePolinomials(StarkInfo &starkInfo, StepsParams &params, __m512i *bufferT_, uint8_t* storePol, uint64_t row, uint64_t nrowsPack, uint64_t domainExtended) {
Expand Down
27 changes: 17 additions & 10 deletions src/starkpil/chelpers_steps_pack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ class CHelpersStepsPack : public CHelpersSteps {
}
}
}
nColsStagesAcc[10] = nColsStagesAcc[9] + nColsStages[9]; // Polinomials f & q
nColsStagesAcc[10] = nColsStagesAcc[9] + nColsStages[4]; // Polinomials f & q
if(stage == 4) {
offsetsStages[10] = starkInfo.mapOffsets.section[eSection::q_2ns];
nColsStages[10] = starkInfo.qDim;
} else if(stage == 5) {
offsetsStages[10] = starkInfo.mapOffsets.section[eSection::f_2ns];
nColsStages[10] = 3;
}
nColsStagesAcc[11] = nColsStagesAcc[10] + 3; // xDivXSubXi
nCols = nColsStagesAcc[11] + 6;
nColsStagesAcc[11] = nColsStagesAcc[10] + nColsStages[10]; // xDivXSubXi
nCols = nColsStagesAcc[11] + 6; // 3 for xDivXSubXi and 3 for xDivXSubWxi
}

inline virtual void storePolinomials(StarkInfo &starkInfo, StepsParams &params, Goldilocks::Element *bufferT_, uint8_t* storePol, uint64_t row, uint64_t nrowsPack, uint64_t domainExtended) {
Expand All @@ -77,15 +77,22 @@ class CHelpersStepsPack : public CHelpersSteps {
bool isTmpPol = !domainExtended && s == 4;
for(uint64_t k = 0; k < nColsStages[s]; ++k) {
uint64_t dim = storePol[nColsStagesAcc[s] + k];
if(storePol[nColsStagesAcc[s] + k]) {
Goldilocks::Element *buffT = &bufferT_[(nColsStagesAcc[s] + k)* nrowsPack];
if(isTmpPol) {
for(uint64_t i = 0; i < dim; ++i) {
Goldilocks::copy_pack(nrowsPack, &params.pols[offsetsStages[s] + k * domainSize + row * dim + i], uint64_t(dim), &buffT[i*nrowsPack]);
}
} else {
if(!TRANSPOSE_TMP_POLS) {
for(uint64_t k = 0; k < nColsStages[s]; ++k) {
Goldilocks::Element *buffT = &bufferT_[(nColsStagesAcc[s] + k)* nrowsPack];
Goldilocks::copy_pack(nrowsPack, &params.pols[offsetsStages[s] + k + row * nColsStages[s]], nColsStages[s], buffT);
}
} else {
if(storePol[nColsStagesAcc[s] + k]) {
Goldilocks::Element *buffT = &bufferT_[(nColsStagesAcc[s] + k)* nrowsPack];
if(isTmpPol) {
for(uint64_t i = 0; i < dim; ++i) {
Goldilocks::copy_pack(nrowsPack, &params.pols[offsetsStages[s] + k * domainSize + row * dim + i], uint64_t(dim), &buffT[i*nrowsPack]);
}
} else {
Goldilocks::copy_pack(nrowsPack, &params.pols[offsetsStages[s] + k + row * nColsStages[s]], nColsStages[s], buffT);
}
}
}
}
}
Expand Down
Loading

0 comments on commit f39b263

Please sign in to comment.