Skip to content
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

Reorganize unit tests and update CICD #37

Merged
merged 2 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
release:
name: Create Release with tag
runs-on: ${{ matrix.os }}
needs: release
strategy:
matrix:
os: [ubuntu-20.04]
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,9 @@ jobs:
- name: Install Dependencies
run: |
pip install -r requirements.txt
- name: Test mock JetStream token utils
- name: Run all unit tests in JetStream (jetstream/tests)
run: |
python -m jetstream.engine.utils_test
- name: Test mock JetStream engine implementation
coverage run -m unittest -v
- name: Create test coverage report
run: |
python -m jetstream.engine.mock_engine_test
- name: Test JetStream core orchestrator
run: |
python -m jetstream.core.orchestrator_test
- name: Test JetStream core server library
run: |
python -m jetstream.core.server_test
coverage report -m
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __pycache__
build/
dist/
google_jetstream.egg-info/
.coverage

# local folders
data/
Expand Down
13 changes: 13 additions & 0 deletions jetstream/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
13 changes: 13 additions & 0 deletions jetstream/tests/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
File renamed without changes.
13 changes: 13 additions & 0 deletions jetstream/tests/engine/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
5 changes: 4 additions & 1 deletion jetstream/tests/engine/test_token_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests functionality of the tokenizer with supported models."""

import os
import unittest
from typing import List
Expand All @@ -24,7 +26,8 @@ class SPTokenizer:
"""Tokenier used in original llama2 git"""

def __init__(self, tokenizer_path: str):
self.tokenizer = SentencePieceProcessor(model_file=tokenizer_path)
self.tokenizer = SentencePieceProcessor()
self.tokenizer.Load(model_file=tokenizer_path)
assert self.tokenizer.vocab_size() == self.tokenizer.get_piece_size()

def decode(self, t: List[int]) -> str:
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
absl-py
coverage
flax
grpcio
jax
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ clu==0.0.10
# via seqio
contextlib2==21.6.0
# via ml-collections
coverage==7.4.4
# via -r requirements.in
dm-tree==0.1.8
# via
# chex
Expand All @@ -49,7 +51,6 @@ etils[array-types,enp,epath,epy,etqdm,etree]==1.6.0
# via
# array-record
# clu
# etils
# orbax-checkpoint
# tfds-nightly
flatbuffers==23.5.26
Expand Down
Loading