If I play Whirlwind, do I have to pay deflect cost if I target an opponent's unit with deflect?

No, you do not have to pay the Deflect cost when playing Whirlwind.

According to the RiftJudge FAQ #3908:

"Whirlwind does not trigger deflect because it does not target. Deflect is a passive ability that levies an additional cost only for spells or abilities that target the permanent with deflect."

Because Whirlwind does not target any units (it instructs players to make a choice, which is not the same as targeting), it does not interact with the Deflect keyword.