Al casting alloys are not usually stress relieved. One method is to heat to a minimum temperature of 345 C for 2-4 hours. Higher temperatures will result in more complete stress relief. Be careful of incipient melting with a 12% Si alloy if you use 530 C.