I don’t think it is a washer, the noise isn’t coming from the faucet. The water heater is (basically) directly below the upstairs bathroom. The noise (deep knocking sound) sounds like it is coming from the floor. And, it doesn’t make the noise when the hot water runs to the shower, just the faucet.
Check the faucet like I told you. You also can turn off stop under Lav. and see if it stops, you could have loose washer on stop at water heater. Start checking all the pipes and stops and faucets. Let me know, check for loose pipes.