Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh authored Oct 29, 2024
2 parents d569eb1 + 064c7fd commit 5434cdb
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/scripts/format-cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

# Checks all the modified c/c++ files, format them and adds them
# to the commit.
for FILE in $(git diff upstream/$1 --name-only | grep -E '.*\.(cc|cpp|h|hpp)$')
for FILE in $(git diff $1/$2 --name-only | grep -E '.*\.(cc|cpp|h|hpp)$')
do
clang-format -i -style=file $FILE
git add $FILE
done
done
4 changes: 2 additions & 2 deletions .github/scripts/format-py.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

# Checks all the modified c/c++ files, format them and adds them
# to the commit.
for FILE in $(git diff upstream/$1 --name-only | grep -E '.*\.py$')
for FILE in $(git diff $1/$2 --name-only | grep -E '.*\.py$')
do
autopep8 --in-place -a $FILE
git add $FILE
done
done
25 changes: 11 additions & 14 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

# Automatic code formatting
name: "format"
on:
pull_request:
Expand All @@ -8,16 +8,14 @@ on:

env:
python_version: "3.9"
repo: "mlcommons/inference"

jobs:
format-code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref || github.ref_name }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Python ${{ env.python_version }}
uses: actions/setup-python@v3
with:
Expand All @@ -29,27 +27,26 @@ jobs:
- name: Grant permissions
run: |
chmod 777 "${GITHUB_WORKSPACE}/.github/scripts/format-cpp.sh"
chmod 777 "${GITHUB_WORKSPACE}/.github/scripts/format-py.sh"
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/format-cpp.sh"
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/format-py.sh"
- name: Format Codebase
if: ${{ github.event.pull_request.base.repo.full_name == env.repo }}
run: |
git remote add upstream ${{ github.event.pull_request.base.repo.clone_url }}
git fetch upstream ${{ github.event.pull_request.base.ref }}
".github/scripts/format-cpp.sh" "${{ github.event.pull_request.base.ref }}"
".github/scripts/format-py.sh" "${{ github.event.pull_request.base.ref }}"
git fetch upstream
".github/scripts/format-cpp.sh" "upstream" "${{ github.event.pull_request.base.ref }}"
".github/scripts/format-py.sh" "upstream" "${{ github.event.pull_request.base.ref }}"
- name: Commit
run: |
cd ${GITHUB_WORKSPACE}
HAS_CHANGES=$(git diff --cached --name-only)
HAS_CHANGES=$(git diff --staged --name-only)
if [ ${#HAS_CHANGES} -gt 0 ]; then
git log
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
git commit -m '[Automated Commit] Format Codebase'
git push upstream ${{ github.head_ref || github.ref_name }}
git push
fi
3 changes: 1 addition & 2 deletions language/bert/accuracy-squad.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@
"int64": np.int64,
"float16": np.float16,
"float32": np.float32,
"float64": np.float64,
}
"float64": np.float64}


def get_final_text(pred_text, orig_text, do_lower_case):
Expand Down
3 changes: 2 additions & 1 deletion tools/submission/submission_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
"llama2-70b-99": ["Server", "Offline"],
"llama2-70b-99.9": ["Server", "Offline"],
"stable-diffusion-xl": ["SingleStream", "Offline", "Server"],
"mixtral-8x7b": ["SingleStream", "Server", "Offline"],
"mixtral-8x7b": ["Server", "Offline"]
},
"optional-scenarios-datacenter-edge": {},
"accuracy-target": {
Expand Down Expand Up @@ -2743,6 +2743,7 @@ def check_measurement_dir(
val.replace(" ", "")
conf_model, conf_scenario, conf_key = key.split(".")
if (

(conf_key == "sample_concatenate_permutation")
and ((conf_model == conf_ref_model) or conf_model == "*")
and ((conf_scenario == scenario) or conf_scenario == "*")
Expand Down

0 comments on commit 5434cdb

Please sign in to comment.