Skip to content

Conversation

@kwasd
Copy link
Contributor

@kwasd kwasd commented Oct 7, 2024

For #2246

@kwasd kwasd requested a review from pbchekin October 7, 2024 13:03
@kwasd
Copy link
Contributor Author

kwasd commented Oct 7, 2024

@vlad-penkin vlad-penkin linked an issue Oct 7, 2024 that may be closed by this pull request
elif [[ "${{ inputs.models }}" == "subset" ]]; then
while read model; do
bash -e $GITHUB_WORKSPACE/scripts/inductor_xpu_test.sh ${{ inputs.suite }} ${{ inputs.dtype }} ${{ inputs.mode }} ${{ inputs.test_mode }} xpu 0 static 1 0 $model
bash -e $GITHUB_WORKSPACE/scripts/inductor_xpu_test.sh ${{ inputs.suite }} ${{ inputs.dtype }} ${{ inputs.mode }} ${{ inputs.test_mode }} xpu 0 static 1 0 $model || ${{ inputs.test_all_subset_models }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work as expected, the script returns 0 even if some accuracy tests or performance runs failed. You need to check the report (csv file) and verify it has all items from a corresponding subset and every item has passed. See https://github.com/intel/intel-xpu-backend-for-triton/blob/main/.github/workflows/build-test-reusable.yml#L179-L181 for the idea.

@kwasd kwasd requested a review from pbchekin October 8, 2024 10:33
@kwasd
Copy link
Contributor Author

kwasd commented Oct 8, 2024

elif [[ "${{ inputs.models }}" == "subset" ]]; then
while read model; do
bash -e $GITHUB_WORKSPACE/scripts/inductor_xpu_test.sh ${{ inputs.suite }} ${{ inputs.dtype }} ${{ inputs.mode }} ${{ inputs.test_mode }} xpu 0 static 1 0 $model
grep ,$model, $WORKSPACE/inductor_log/*/*/*.csv | grep -q ,pass, || ${{ inputs.test_all_subset_models }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will work only for accuracy. Also for accuracy it is possible that CSV file does not exist (major failure with E2E) in this case the one liner above won't work. I think you need more sophisticated script to handle accuracy/performance and all corner cases. The idea is you need to check that every model from the subset was successfully executed.

@kwasd kwasd marked this pull request as draft October 9, 2024 11:03
@kwasd kwasd marked this pull request as ready for review October 21, 2024 13:48
@kwasd kwasd requested a review from pbchekin October 21, 2024 14:15


def check_report(suite, dtype, mode, test_mode, device, models_file):
inductor_log_dir = Path("torch_compile_debug") / suite / dtype
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the right location is inductor_log. Anyways, it is better to pass it as a parameter.

argparser = argparse.ArgumentParser()
argparser.add_argument("--suite", required=True)
argparser.add_argument("--dtype", required=True)
argparser.add_argument("--mode", required=True, choices=("training", "inference"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mode sting can be inference-no-freezing (see the workflow inputs). The location needs to be inference in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The location needs to be inference in this case.

What do you mean? Here is example of a CSV file name: timm_models/amp_fp16/inductor_timm_models_amp_fp16_inference-no-freezing_xpu_accuracy.csv

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh you probably right.

exitcode = 0

with open(models_file, encoding="utf-8") as f:
subset = f.read().strip().split("\n")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: use readlines().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This leaves newlines.
f.read().splitlines() works

@kwasd
Copy link
Contributor Author

kwasd commented Oct 21, 2024

@kwasd kwasd merged commit b6cdccd into main Oct 21, 2024
96 of 98 checks passed
@kwasd kwasd deleted the feature/2246-e2e-accuracy-subset branch October 21, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subset of E2E models for accuracy tests

3 participants