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

Refactoring to 1.5.1 #1792

Open
wants to merge 67 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
d2a6fd9
+ compatibility with CUDA 11.0
mmarcinmichal Jun 30, 2023
48f097c
+ compatibility with CUDA 11.0
mmarcinmichal Jun 30, 2023
8cc0b42
Update build.yaml
mmarcinmichal Aug 28, 2023
af6332b
Update build.yaml
mmarcinmichal Aug 28, 2023
aa354f0
Update build.yaml
mmarcinmichal Aug 28, 2023
63d7990
Update build.yaml
mmarcinmichal Aug 28, 2023
a72422d
Update rnn_test.py
mmarcinmichal Aug 29, 2023
605f122
Update rnn_test.py
mmarcinmichal Aug 29, 2023
b9d5739
+ add test_fork.py
mmarcinmichal Sep 28, 2023
e82f33b
Merge branch 'master' of https://github.com/mmarcinmichal/trax
mmarcinmichal Sep 28, 2023
cc46a6d
+ build
mmarcinmichal Oct 2, 2023
34abf50
+ build
mmarcinmichal Oct 2, 2023
de9862f
+ build
mmarcinmichal Oct 2, 2023
02b8d17
+ build
mmarcinmichal Oct 2, 2023
f53b338
+ build
mmarcinmichal Oct 2, 2023
9c849bf
+ build
mmarcinmichal Oct 2, 2023
cac2053
+ build
mmarcinmichal Oct 2, 2023
698d0fd
+ build
mmarcinmichal Oct 2, 2023
241ce7e
+ build
mmarcinmichal Oct 2, 2023
ad1d76d
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 4, 2023
918f8a2
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 6, 2023
2b62eb8
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
244b522
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
7589fd2
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
d8a5605
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
31c060c
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
59abb4d
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
3aa35cf
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
1d57eaf
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
a92098b
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
fb0302f
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
fd6abf6
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
b3d2871
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
6f35bab
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
6b12922
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
b5853d0
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
338f526
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
62dda26
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
baf28b8
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
a1db8c8
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
d801be5
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
f9f6189
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
a2921a1
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
7fce6a3
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 16, 2023
e0f5de1
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 17, 2023
b524feb
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 17, 2023
9678b54
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 17, 2023
0d13004
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 17, 2023
d08d535
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 17, 2023
0c6a7ed
- Refactoring combatible with the following runtime enviroment
mmarcinmichal Oct 17, 2023
a1c0168
- Build information
mmarcinmichal Oct 19, 2023
e4582d1
- Build information
mmarcinmichal Oct 20, 2023
3fcd8d5
- Build information
mmarcinmichal Oct 20, 2023
c505bfb
- New version to release
mmarcinmichal Nov 14, 2023
90e42cc
Create codeql.yml
mmarcinmichal Nov 14, 2023
11ac771
- TF 2.14.0
mmarcinmichal Nov 24, 2023
18b0c3d
- TF 2.14.0
mmarcinmichal Nov 24, 2023
5d6b823
- TF 2.14.0
mmarcinmichal Nov 24, 2023
7aad754
- TF 2.14.0
mmarcinmichal Nov 24, 2023
80d7bc1
- TF 2.14.0
mmarcinmichal Nov 24, 2023
fbbaf43
- TF 2.14.0
mmarcinmichal Nov 24, 2023
2ddfaf2
- TF 2.11.0
mmarcinmichal Nov 24, 2023
eb06512
- TF 2.11.0
mmarcinmichal Nov 24, 2023
8819636
- TF 2.13.0
mmarcinmichal Nov 24, 2023
84291ff
- numpy==1.23.5
mmarcinmichal Nov 27, 2023
497b570
- numpy==1.23.5
mmarcinmichal Nov 27, 2023
73a3cf5
- numpy==1.23.5
mmarcinmichal Dec 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
142 changes: 92 additions & 50 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ name: build
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
branches: [ "master" ]
pull_request:
branches: [ master ]
branches: [ "master" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -37,55 +37,97 @@ jobs:

strategy:
matrix:
python-version: [3.7]
# tf-nightly has some pip version conflicts, so can't be installed.
# Use only numbered TF as of now.
# tf-version: ["2.4.*", "tf-nightly"]
tf-version: ["2.4.*"]
python-version: [ '3.10' ]
# Which tf-version run.
tf-version: [ '2.13.0' ]
# Which set of tests to run.
trax-test: ["lib", "research"]
trax-test: [ 'lib','research' ]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -q -U setuptools numpy
python -m pip install flake8 pytest
if [[ ${{matrix.tf-version}} == "tf-nightly" ]]; then python -m pip install tf-nightly; else python -m pip install -q "tensorflow=="${{matrix.tf-version}}; fi
pip install -e .[tests,t5]
# # Lint with flake8
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# Test out right now with only testing one directory.
- name: Test with pytest
run: |
TRAX_TEST=" ${{matrix.trax-test}}" ./oss_scripts/oss_tests.sh
# The below step just reports the success or failure of tests as a "commit status".
# This is needed for copybara integration.
- name: Report success or failure as github status
if: always()
shell: bash
run: |
status="${{ job.status }}"
lowercase_status=$(echo $status | tr '[:upper:]' '[:lower:]')
curl -sS --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"state": "'$lowercase_status'",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"description": "'$status'",
"context": "github-actions/build"
}'
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v3
with:
python-version: ${{matrix.python-version}}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools
python -m pip install numpy==1.23.5
python -m pip install flake8 pytest
python -m pip install orbax-checkpoint orbax-export
python -m pip install tensorflow_datasets==4.2.0
python -m pip install tensorflow_metadata==1.6.0
python -m pip install tensorflow-text==2.13.0
python -m pip install pandas==2.1.1
python -m pip install matplotlib==3.8.0
python -m pip install multimethod==1.10
python -m pip install natsort==8.4.0
python -m pip install omegaconf==2.3.0
python -m pip install nltk==3.8.1
python -m pip install pytest==7.4.2
python -m pip install hydra-core==1.3.2
python -m pip install scikit-learn==1.3.1
python -m pip install pympler==1.0.1
python -m pip install IPython==8.16.1
python -m pip install mypy==1.5.1
python -m pip install pylint==2.17.7
python -m pip install black==23.9.1
python -m pip install openpyxl==3.1.2
python -m pip install numba==0.58.0
python -m pip install parameterized==0.9.0
python -m pip install mock==5.1.0
python -m pip install tfds-nightly==4.6.0.dev202210050045
python -m pip install editdistance==0.6.2
python -m pip install pyglove==0.4.3
python -m pip install sentencepiece==0.1.99
python -m pip install babel==2.13.0
python -m pip install rouge-score==0.1.2
python -m pip install sacrebleu==2.3.1
python -m pip install transformers==4.33.3
python -m pip install mesh-tensorflow==0.1.21
python -m pip install torch==2.0.1+cu118 -f https://download.pytorch.org/whl/cu118/torch_stable.html
python -m pip install protobuf==3.20.3
python -m pip install t5==0.9.2 --no-dependencies tensorflow
python -m pip install seqio --no-deps tensorflow
python -m pip install funcsigs==1.0.2
python -m pip install absl-py==1.4.0
python -m pip install gym==0.26.2
python -m pip install gin-config==0.5.0
python -m pip install jax==0.4.20
python -m pip install jaxlib==0.4.20
python -m pip install psutil==5.9.5
python -m pip install scipy==1.11.3
python -m pip install six==1.14.0
python -m pip install attrs==23.1.0
python -m pip install mock==5.1.0
python -m pip install parameterized==0.9.0
python -m pip install pylint==2.17.7
python -m pip install pytest==7.4.2
python -m pip install wrapt==1.15.0
python -m pip install tensor2tensor==1.15.7
python -m pip install clu==0.0.10
# Test out right now with only testing one directory.
- name: Test with pytest
run: |
TRAX_TEST="${{matrix.trax-test}}" ./oss_scripts/oss_tests.sh
# The below step just reports the success or failure of tests as a "commit status".
# This is needed for copy bara integration.
- name: Report success or failure as github status
if: always()
shell: bash
run: |
status="${{ job.status }}"
lowercase_status=$(echo $status | tr '[:upper:]' '[:lower:]')
curl -sS --request POST \
--url https://api.github.com/repos/${{github.repository}}/statuses/${{github.sha}} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"state": "'$lowercase_status'",
"target_url": "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}",
"description": "'$status'",
"context": "github-actions/build"
}'
82 changes: 82 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "1.5.1" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "1.5.1" ]
schedule:
- cron: '31 4 * * 1'

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
version: 3.10
install:
- requirements: docs/requirements.txt
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ git:
depth: 3
quiet: true
python:
- "3.6"
- "3.10"
env:
global:
- TF_VERSION="2.4.*"
- TF_VERSION="2.11.0"
matrix:
- TRAX_TEST="lib"
- TRAX_TEST="research"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
version](https://badge.fury.io/py/trax.svg)](https://badge.fury.io/py/trax)
[![GitHub
Issues](https://img.shields.io/github/issues/google/trax.svg)](https://github.com/google/trax/issues)
![GitHub Build](https://github.com/google/trax/actions/workflows/build.yaml/badge.svg)
![GitHub Build](https://github.com/mmarcinmichal/trax/actions/workflows/build.yaml/badge.svg)
[![Contributions
welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](CONTRIBUTING.md)
[![License](https://img.shields.io/badge/License-Apache%202.0-brightgreen.svg)](https://opensource.org/licenses/Apache-2.0)
Expand Down
2 changes: 1 addition & 1 deletion docs/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
version: 3.10
install:
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion oss_scripts/oss_pip_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#!/bin/bash

set -v # print commands as they're executed
set -e # fail and exit on any command erroring
set -e # fail and exit on any command error

: "${TF_VERSION:?}"

Expand Down
8 changes: 4 additions & 4 deletions oss_scripts/oss_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
#!/bin/bash

set -v # print commands as they're executed
set -e # fail and exit on any command erroring
set -e # fail and exit on any command error

GIT_COMMIT_ID=${1:-""}
[[ -z $GIT_COMMIT_ID ]] && echo "Must provide a commit" && exit 1

TMP_DIR=$(mktemp -d)
pushd $TMP_DIR
pushd "$TMP_DIR"

echo "Cloning trax and checking out commit $GIT_COMMIT_ID"
git clone https://github.com/google/trax.git
cd trax
git checkout $GIT_COMMIT_ID
git checkout "$GIT_COMMIT_ID"

python3 -m pip install wheel twine pyopenssl

Expand All @@ -42,4 +42,4 @@ python3 -m twine upload dist/*
# Cleanup
rm -rf build/ dist/ trax.egg-info/
popd
rm -rf $TMP_DIR
rm -rf "$TMP_DIR"