rework device type filter rule (#55753)
Summary:
Currently common_device_type generates device-specific test based on vague rules. see https://github.com/pytorch/pytorch/issues/55707.
This should fix https://github.com/pytorch/pytorch/issues/55707
# Changes included
This PR changes the rule:
1. First user provided args (`except_for` and `only_for`) are processed to filter out desired device type from a ALL_AVAILABLE_LIST
2. Then environment variables are processed the exact same way.
tests are generated based on the final filtered list.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/55753
Test Plan: CI
Reviewed By: seemethere, ngimel
Differential Revision: D27709192
Pulled By: walterddr
fbshipit-source-id: 1d5378ef013b22a7fb9fdae24b486730b2e67401
Author
Rong Rong (AI Infra)