A canister is required only in Yosemite NP, and the 34 mile stretch between Pinchot Pass and Forester Pass. But you will have more flexibility if you have one for the entire trip, IMHO.
There are many threads debating this topic. Search around for "JMT canister".
Edit: ...and from Whitney Junction to the Portal.