Skip to content

model: add attn_mask_type & position_ids #1656

model: add attn_mask_type & position_ids

model: add attn_mask_type & position_ids #1656

name: Optimum-rbln / PR
on:
pull_request:
branches:
- main
- dev
env:
REBEL_PYPI_ENDPOINT: ${{ vars.REBEL_PYPI_INTERNAL_ENDPOINT }}
REBEL_PYPI_USERNAME: ${{ secrets.REBEL_PYPI_USERNAME }}
REBEL_PYPI_PASSWORD: ${{ secrets.REBEL_PYPI_PASSWORD }}
jobs:
head-commit-message:
runs-on: rebel-k8s-runner
outputs:
message: ${{ steps.get_commit_message.outputs.message }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Get head commit message
id: get_commit_message
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
echo "message<<EOF" >> $GITHUB_OUTPUT
echo "$COMMIT_MESSAGE" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "COMMIT_MESSAGE=$COMMIT_MESSAGE"
check-pytest-full:
needs: head-commit-message
runs-on: rebel-k8s-runner
outputs:
should_full_test: ${{ contains(needs.head-commit-message.outputs.message, '[pytest-full]') && 'true' || 'false' }}
steps:
- name: Check if [pytest-full] is in commit message
run: |
if [[ "${{ contains(needs.head-commit-message.outputs.message, '[pytest-full]') }}" == "true" ]]; then
echo "Found [pytest-full] in commit message, running full pytest"
else
echo "No [pytest-full] found, continuing with default pytest"
fi
check-slack-report:
needs: head-commit-message
runs-on: rebel-k8s-runner
outputs:
should_slack_report: ${{ contains(needs.head-commit-message.outputs.message, '[slack-report]') && 'true' || 'false' }}
steps:
- name: Check if [slack-report] is in commit message
run: |
if [[ "${{ contains(needs.head-commit-message.outputs.message, '[slack-report]') }}" == "true" ]]; then
echo "Found [slack-report] in commit message, reporting slack"
else
echo "No [slack-report] found, continuing without reporting slack"
fi
check-code-quality:
uses: ./.github/workflows/check_code_quality.yml
test-docstrings:
uses: ./.github/workflows/test-docstrings.yml
load-version:
runs-on: rebel-k8s-runner
needs: [check-code-quality, test-docstrings]
outputs:
compiler_version: ${{ steps.get_version.outputs.compiler_version }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get compiler version
id: get_version
run: |
VERSION=$(grep rebel_compiler_version .github/version.yaml | cut -d ':' -f2 | tr -d ' ')
echo "compiler_version=$VERSION" >> $GITHUB_OUTPUT
check-compiler:
needs: [check-code-quality, test-docstrings, load-version]
uses: ./.github/workflows/rbln_check_compiler.yaml
with:
compiler_version: ${{ needs.load-version.outputs.compiler_version }}
secrets: inherit
check-team-member:
runs-on: rebel-k8s-runner
needs: [check-code-quality, test-docstrings, check-compiler]
outputs:
is_team_member: ${{ steps.check_member.outputs.IS_TEAM_MEMBER }}
steps:
- name: Fetch team members
id: fetch_team
run: |
response=$(curl -s -H "Authorization: Bearer ${{ secrets.GIT_PAT }}" \
-H "Content-Type: application/json" \
-d '{"query":"query { organization(login: \"rebellions-sw\") { team(slug: \"rebel-sw-team\") { members(first: 100) { nodes { login } } } } }"}' \
https://api.github.com/graphql)
echo "$response" | jq -r '.data.organization.team.members.nodes[].login' > team_members.txt
- name: Check if PR author is a team member
id: check_member
run: |
pr_author=${{ github.event.pull_request.user.login }}
if grep -qx "$pr_author" team_members.txt; then
echo "IS_TEAM_MEMBER=true" >> $GITHUB_OUTPUT
else
echo "IS_TEAM_MEMBER=false" >> $GITHUB_OUTPUT
fi
# Default PR test if not Dependency update
optimum-rbln-pytest:
needs: [check-code-quality, test-docstrings, check-compiler, check-team-member, check-pytest-full]
if: |
needs.check-pytest-full.outputs.should_full_test != 'true' &&
needs.check-team-member.outputs.is_team_member == 'true'
uses: ./.github/workflows/rbln_optimum_pytest.yaml
with:
ref: ${{ github.event.pull_request.head.sha }}
rebel_compiler_version: ${{ needs.check-compiler.outputs.compiler_version }}
test_level: "default"
secrets: inherit
# Full Schedule test if Dependency update
optimum-rbln-dependency-pytest:
needs: [check-compiler, check-team-member, check-pytest-full, check-slack-report]
if: |
needs.check-pytest-full.outputs.should_full_test == 'true' &&
needs.check-team-member.outputs.is_team_member == 'true'
uses: ./.github/workflows/rbln_optimum_full_test.yaml
with:
rebel_compiler_version: ${{ needs.check-compiler.outputs.compiler_version }}
ref: ${{ github.event.pull_request.head.sha }}
report_slack: ${{ needs.check-slack-report.outputs.should_slack_report == 'true' }}
secrets: inherit