Fair? My boys would think it fair, if I told them up front it was a hill giant. They'd STILL attack it.
For what it's worth, I think it's fair if it was an ancient red dragon. There are bad things in the world, and they don't morph into stronger or weaker versions depending on the level of the pcs who happen to walk by.
I also think it's fair because you have to give the players a chance to "play" their characters as well - a barbarian or half-orc character with low wisdom and int might well, in character, charge something too strong.... I can remember one player looking at me over the table, and said (OOG) "This may get me killed, but it's what he'd do here...."
I think that this is a "Fair" encounter as you didn't railroad them into having to fight the giant. I can certainly agree that player's should know when to fight and when to run. However, by putting an encounter like this in your game you run the risk of a TPK.
I had a very similar experience as a player in a 1st Ed. AD&D game. We were a first level party on our first adventure when we camped for the night. My character was on watch when the DM described what appeared to be a nightmare (big black horse with flaming hooves) that appeared at the edge of our camp.
I must admit to doing some meta-gaming here. I figured that it must be an illusion as it didn't immediately attack and I knew that it was way too high level for us to fight, so I toosed a pebble at it.
Wrong move. The nightmare was not an illusion. It stomped our entire party into the ground. The DM asked us why we didn't run when we saw it and I asked him why he had a monster like that appear at our campsite. He said that it was part of the random encounter table for the module he was running.
Was the encounter fair? Yes. However, putting an encounter like that in the adventure really didn't serve much of a purpose and led to a TPK and having to restart the campaign.
I voted fair with one caveat. How experiened are your players? If they know how tough giants are, then no problem. If they're newbies, then they would need some clues that he's too tough for them.
Whether it's "fair" is not here nor there. Life after all isn't always "fair" now, is it? What's relevant is whether the players have fun during this encounter or not. That's what matters.