-
Notifications
You must be signed in to change notification settings - Fork 215
chore(backward): integrate backward compat data #2493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
caf0758
to
f20c604
Compare
dbfff3d
to
c98e0c7
Compare
Note that cache seems to be temporary down? |
I don't know if it's a problem on our end or with the github cache service 🤔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
But I haven't reviewed the github action file change
I wonder if it would make sense to merge tfhe-backward-compat
and backward-compatibility
crates (in a later PR)
Thanks a lot for this PR, will be useful!
//! Tests breaking change in serialized data by trying to load historical data stored in https://github.com/zama-ai/tfhe-backward-compat-data. | ||
//! For each tfhe-rs module, there is a folder with some serialized messages and a [ron](https://github.com/ron-rs/ron) | ||
//! Tests breaking change in serialized data by trying to load historical data stored in | ||
//! `utils/tfhe-backward-compat-data`. For each tfhe-rs module, there is a folder with some serialized messages and a [ron](https://github.com/ron-rs/ron) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could clarify that data is stored with git lfs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -2,9 +2,9 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file could be renamed pull_...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
else | ||
git clone $1 -b $2 --depth 1 $3 | ||
fi | ||
git lfs pull --include="$1/*" --exclude="*.hpu" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are both include
and exclude
needed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know I copied from hpu doc which uses an empty exclude
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Only paths which are matched by fetchinclude and not matched by fetchexclude will have objects fetched for them." from
https://manpages.ubuntu.com/manpages/focal/man1/git-lfs-pull.1.html
I guess we could remove exclude
in every git lfs pull
in the repo and only use the relevant include
Also, we could have a single pull_from_lfs
script which takes a wildcard as argument
And 2 make targets pull_backward_compat_data
and pull_hpu_files
which call the same above script with different arguments
And call these targets instead of calling git lfs pull
everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the problem with having dedicated git lfs pull commands ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script checks that git lfs exits
IMO either we think it's useful and we should use this script everywhere
Or not and then we should remove it and call git lfs directly everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zama-ai/hardware would a command like make pull_hpu_files
(or whatever name you want) be ok for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually both include and exclude are needed because there is a default value for exclude in .lfsconfig
so we need to override it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Makefile
Outdated
@@ -263,6 +249,9 @@ install_mlc: install_rs_build_toolchain | |||
.PHONY: fmt # Format rust code | |||
fmt: install_rs_check_toolchain | |||
cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" fmt | |||
cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" -Z unstable-options -C utils/tfhe-backward-compat-data fmt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use BACKWARD_COMPAT_DATA_DIR
here and other places (or remove this variable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
2a0fffc
to
71d2476
Compare
71d2476
to
4162559
Compare
Technically there is no backward-compatibility crate, this is a module inside the However I plan to split the |
4162559
to
640c7fa
Compare
I changed the heuristic to hint that the data may have not been pulled. |
else | ||
git clone $1 -b $2 --depth 1 $3 | ||
fi | ||
git lfs pull --include="$1/*" --exclude="*.hpu" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Only paths which are matched by fetchinclude and not matched by fetchexclude will have objects fetched for them." from
https://manpages.ubuntu.com/manpages/focal/man1/git-lfs-pull.1.html
I guess we could remove exclude
in every git lfs pull
in the repo and only use the relevant include
Also, we could have a single pull_from_lfs
script which takes a wildcard as argument
And 2 make targets pull_backward_compat_data
and pull_hpu_files
which call the same above script with different arguments
And call these targets instead of calling git lfs pull
everywhere
I guess but I don't want to touch hpu workflow in this pr |
640c7fa
to
bdeb057
Compare
Makefile
Outdated
|
||
tests/$(BACKWARD_COMPAT_DATA_DIR): clone_backward_compat_data | ||
.PHONY: pull_hpu_files # Pull the hpu files | ||
pull_hpu_file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lacks an s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -217,7 +217,7 @@ source setup_hpu.sh --config v80 | |||
> NB: Error that occurred when ".hpu" files weren't correctly fetch could be a bit enigmatic: `memory allocation of ... bytes failed` | |||
> If you encountered this issue, you should run the following command: | |||
> ```bash | |||
> git lfs pull --include="*" --exclude="" | |||
> make pull_hpu_files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change could also be done in benchmark_hpu_integer.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
bdeb057
to
5ef12e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not knowledgeable to review file .github/workflows/aws_tfhe_backward_compat_tests.yml
Reviewed 13 of 125 files at r1, 9 of 9 files at r3, 4 of 4 files at r4, 4 of 4 files at r6, all commit messages.
Reviewable status: 20 of 128 files reviewed, all discussions resolved (waiting on @IceTDrinker and @soonum)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
questions/comments, looks good generally speaking
Reviewed 117 of 125 files at r1, 6 of 9 files at r3, 1 of 4 files at r4, 4 of 4 files at r6, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @soonum)
tests/backward_compatibility_tests.rs
line 28 at r6 (raw file):
}; if !root_dir.exists() {
I would keep this if we move stuff around, we had an issue with Cargo manifest at some point ?
utils/tfhe-backward-compat-data/.linelint.yml
line 1 at r6 (raw file):
ignore:
this file necessary ? feels like I saw the ignore for ron elsewhere
.github/workflows/aws_tfhe_backward_compat_tests.yml
line 86 at r6 (raw file):
with: path: | utils/tfhe-backward-compat-data/**/*.cbor
/data would be enough ? no need for globbing I think ?
.github/workflows/aws_tfhe_backward_compat_tests.yml
line 105 at r6 (raw file):
with: path: | utils/tfhe-backward-compat-data/**/*.cbor
same here
Makefile
line 1055 at r6 (raw file):
.PHONY: test_backward_compatibility_ci test_backward_compatibility_ci: install_rs_build_toolchain TFHE_BACKWARD_COMPAT_DATA_DIR="../$(BACKWARD_COMPAT_DATA_DIR)" RUSTFLAGS="$(RUSTFLAGS)" cargo $(CARGO_RS_BUILD_TOOLCHAIN) test --profile $(CARGO_PROFILE) \
../ seems a bit counterintuitive ?
Makefile
line 1059 at r6 (raw file):
.PHONY: test_backward_compatibility # Same as test_backward_compatibility_ci but tries to clone the data repo first if needed test_backward_compatibility: pull_backward_compat_data test_backward_compatibility_ci
what effect does the pull have if we are modifying lfs files to add new data e.g. ?
5ef12e4
to
5fb3d15
Compare
5fb3d15
to
17bfd7b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 127 of 128 files reviewed, 5 unresolved discussions (waiting on @IceTDrinker, @mayeul-zama, and @soonum)
Makefile
line 1055 at r6 (raw file):
Previously, IceTDrinker (Arthur Meyre) wrote…
../ seems a bit counterintuitive ?
Because $(BACKWARD_COMPAT_DATA_DIR) is from TFHE-rs root folder but the cargo test driver will run the test from the tests
folder
Makefile
line 1059 at r6 (raw file):
Previously, IceTDrinker (Arthur Meyre) wrote…
what effect does the pull have if we are modifying lfs files to add new data e.g. ?
git lfs pull does not override local modifications (I just tested it)
.github/workflows/aws_tfhe_backward_compat_tests.yml
line 86 at r6 (raw file):
Previously, IceTDrinker (Arthur Meyre) wrote…
/data would be enough ? no need for globbing I think ?
the files are inside utils/tfhe-backward-compat-data/{0_8, 0_10, 0_11,...}/ so we need the globing. And this line is telling "any cbor file inside utils/tfhe-backward-compat-data/" which I feel is what we want (more robust that direct path)
tests/backward_compatibility_tests.rs
line 28 at r6 (raw file):
Previously, IceTDrinker (Arthur Meyre) wrote…
I would keep this if we move stuff around, we had an issue with Cargo manifest at some point ?
done
utils/tfhe-backward-compat-data/.linelint.yml
line 1 at r6 (raw file):
Previously, IceTDrinker (Arthur Meyre) wrote…
this file necessary ? feels like I saw the ignore for ron elsewhere
yes I forgot to remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot !
We should be able to set the other repo as an archive once this is merged pending the CI fix
Reviewed 1 of 1 files at r7, 1 of 1 files at r8, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @soonum)
Makefile
line 1055 at r6 (raw file):
Previously, nsarlin-zama (Nicolas Sarlin) wrote…
Because $(BACKWARD_COMPAT_DATA_DIR) is from TFHE-rs root folder but the cargo test driver will run the test from the
tests
folder
ok makes sense
.github/workflows/aws_tfhe_backward_compat_tests.yml
line 86 at r6 (raw file):
Previously, nsarlin-zama (Nicolas Sarlin) wrote…
the files are inside utils/tfhe-backward-compat-data/{0_8, 0_10, 0_11,...}/ so we need the globing. And this line is telling "any cbor file inside utils/tfhe-backward-compat-data/" which I feel is what we want (more robust that direct path)
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 127 of 128 files reviewed, all discussions resolved (waiting on @IceTDrinker and @soonum)
closes: please link all relevant issues
PR content/description
Integrate backward compat data inside TFHE-rs main repo. This should simplify the process to add new data. Once this pr is merged, the old repo should be archived but kept to be able to run tests on old versions.
The lfs data will not be cloned by default to avoid impacting dev experience, but running
make clone_backward_compat_data
will clone them.The data cache in ci is now based on the hash of the lfs files, because we previously used the commit sha of the target repo
This change is