The Savage Attacker feat states (PHB p169):
Once per turn when you roll damage for a melee weapon attack, you can reroll the weapon's damage dice and use either total.
The Great Weapon Fighting style stats (PHB p72):
When you roll a 1 or 2 on a damage die for an attack you make with a melee weapon that you are wielding with two hands, you can reroll the die and must use the new roll, even if the new roll is a 1 or a 2.
How do these interact?
There's a few possibilities that come to mind, but I'm not sure which is the correct interpretation, if any:
They're mutually exclusive, you can only apply the effects of one of the two on any given attack.
If you use GWF before SA, you cannot use SA. You can apply GWF after SA, but only to one of the rolls. This is based on the wording for GWF "must use the new roll."
You're stuck with the results of the roll you applied GWF to.
You can pick either of the rolls after applying GWF to one of them.
You can use both on the same attack, but GWF only applies to the original roll, not the reroll granted by SA.
You can use both on the same attack, but you have to choose one of the rolls to apply GWF to, it can't be both.
You can use both on the same attack, and GWF can be used on both the original roll and the SA reroll.