In a bowl, beat sugar, butter and milk. Combine flour, cocoa, baking powder and salt; stir into the sugar mixture. Add walnuts. Pour into a greased 9-in. square baking pan. For topping, combine sugars and cocoa; sprinkle over batter. Pour water over all. Do not stir. Bake at 350° for 30 minutes. Cool for 10 minutes. Spoon some of the fudge sauce over each serving; top with ice cream if desired.