Australia's annual inflation rose to 4% in August from 3.5% in July, while underlying inflation held at 3.6% for the third month.