Skip to content

Replace blacklist/whitelist throughout the PyTorch codebase #41443

@SplitInfinity

Description

@SplitInfinity

Goal

The goal of this issue is to track overall progress toward eliminating the use of the terms whitelist and blacklist from the PyTorch codebase. The recommended replacements for these terms are allowlist and blocklist, respectively. See this numpy issue for more information.

However, we should strive to use more specific and appropriate terms based on the context in which whitelist and blacklist are used. For example, if the code in question constructs a list of tests that are to be skipped and stores it into a variable called test_blacklist, test_skiplist would be a better choice than test_blocklist. But if there are no other options, allowlist and blocklist are the designated fallback terms.

How To Help

  1. Pick a file from the list below. Comment on the issue saying that you are working on it and assign it to yourself.
  2. Work on your task. Replace all instances of blacklist or whitelist as appropriate. Submit a PR. Make sure your PR complies with the PyTorch code review values.
  3. Choose someone who is familiar with the code in question to review your PR. GitHub UI can help with this.
  4. Merge your PR (or get someone from the team to merge it).

Unexpected Issues

It is possible that a simple find-and-replace strategy will not work for some of the occurrences in the list below. A good example is aten/src/ATen/gen.py; this tool has command-line flags with whitelist in them that are consumed by other tools. We need to be more careful in these cases. For now, if you come across a case like this, leave a comment in the issue detailing your findings and edit this post to link the corresponding file to that issue or comment below.

To-Do List

Blacklist

Whitelist

Metadata

Metadata

Assignees

Labels

better-engineeringRelatively self-contained tasks for better engineering contributorsgood first issuetriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions