You must have chains when entering a chain controlled designated area, it is a legal requirement. The weather is 'boss' in this situation as you don't know exactly when they will be needed, but you need to have them and be prepared to use them as and when needed.
Yes it would be dangerous to not use them when required and that is why the law is in place in the first instance. You can buy them quite cheaply in stores like Walmart and it is wise to practice putting them on in a parking lot in reasonable conditions. It's a lot better than opening the packet for the first time on a mountain road in a blizzard !
The penalty could be up to $5000 for not using them and if you are not carrying any at the time, you could be forced to pay to be towed out or have a company come out and fit chains, both very expensive options !
I do believe that there are chain fitting crews along the roads into Yosemite who will fit them for you, but I don't think they supply them and if they did, I would imagine it would be at a premium.
A couple of links here and here will give you more info. Not all rental companies object to using tyre chains or cables, but I have read that most do not supply them, and those who do not object to you using them may state that you are responsible for any damage caused by having them fitted. You will have to sort out who is who as I have no first hand experience, but I have also read that Hertz is one such company that allows you to fit them at your own risk.